Skip to content

Update apply-setters, create-setters and ensure-name-substring#1240

Open
mozesl-nokia wants to merge 6 commits into
kptdev:mainfrom
nokia:4406-batch-1
Open

Update apply-setters, create-setters and ensure-name-substring#1240
mozesl-nokia wants to merge 6 commits into
kptdev:mainfrom
nokia:4406-batch-1

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Contributor

@mozesl-nokia mozesl-nokia commented Apr 24, 2026

As the title implies, updated apply-setters, create-setters and ensure-name-substring to use the latest versions of their direct dependencies, adjusting them to the API changes.

Part of #4406

~450 lines are just third party code copied from kustomize

Copilot AI review requested due to automatic review settings April 24, 2026 11:56
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for krm-function-catalog canceled.

Name Link
🔨 Latest commit 40f8baa
🔍 Latest deploy log https://app.netlify.com/projects/krm-function-catalog/deploys/69f09b6b03b4c1000859e6d8

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the apply-setters, create-setters, and ensure-name-substring Go functions to newer kustomize / kyaml dependencies and adjusts implementation details to match the updated APIs.

Changes:

  • Bumped kustomize/api, kustomize/kyaml, Kubernetes libs, and other Go dependencies across the three functions.
  • Migrated apply-setters / create-setters to the newer framework.ResourceList.Results output shape.
  • Updated ensure-name-substring filters and default field spec sourcing to account for upstream API changes.

Reviewed changes

Copilot reviewed 9 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
functions/go/ensure-name-substring/nameref/nameref.go Switches default config source and adapts to new ResMap API surface.
functions/go/ensure-name-substring/main.go Reads default field specs from local constants instead of upstream plugin constants.
functions/go/ensure-name-substring/ensure_name_substring.go Updates filter usage for prefix/suffix and adds JSON unmarshalling workaround.
functions/go/ensure-name-substring/consts/builtinpluginconsts.go Adds local copies of builtin field spec constants removed from public upstream API.
functions/go/ensure-name-substring/go.mod Dependency upgrades for ensure-name-substring module.
functions/go/ensure-name-substring/go.sum Lockfile updates reflecting upgraded dependencies.
functions/go/create-setters/main.go Updates result reporting to new ResourceList.Results API.
functions/go/create-setters/go.mod Dependency upgrades for create-setters module.
functions/go/create-setters/go.sum Lockfile updates reflecting upgraded dependencies.
functions/go/create-setters/createsetters/create_setters_test.go Updates YAML fixtures (currently breaks indentation/validity).
functions/go/apply-setters/main.go Updates result reporting to new ResourceList.Results API.
functions/go/apply-setters/go.mod Dependency upgrades for apply-setters module.
functions/go/apply-setters/go.sum Lockfile updates reflecting upgraded dependencies.
functions/go/apply-setters/applysetters/apply_setters_test.go Updates YAML fixtures (currently breaks indentation/validity).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions/go/ensure-name-substring/nameref/nameref.go Outdated
Comment thread functions/go/ensure-name-substring/ensure_name_substring.go
Comment thread functions/go/ensure-name-substring/ensure_name_substring.go Outdated
Comment thread functions/go/create-setters/main.go
Comment thread functions/go/apply-setters/main.go
Comment thread functions/go/create-setters/createsetters/create_setters_test.go
Comment thread functions/go/apply-setters/applysetters/apply_setters_test.go
Comment thread functions/go/ensure-name-substring/consts/builtinpluginconsts.go Outdated
@mozesl-nokia
Copy link
Copy Markdown
Contributor Author

Will wait for #1242

@mozesl-nokia mozesl-nokia added dependencies Pull requests that update a dependency file go Pull requests that update Go code do not merge-hold On hold because some other task must be performed before this PR can be merged. labels Apr 24, 2026
@mozesl-nokia mozesl-nokia marked this pull request as draft April 27, 2026 07:32
@mozesl-nokia mozesl-nokia marked this pull request as draft April 27, 2026 07:32
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@mozesl-nokia mozesl-nokia removed the do not merge-hold On hold because some other task must be performed before this PR can be merged. label Apr 27, 2026
@mozesl-nokia mozesl-nokia marked this pull request as ready for review April 27, 2026 15:27
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 18 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

functions/go/ensure-name-substring/third_party/sigs.k8s.io/kustomize/api/accumulator/namereferencetransformer.go:52

  • In FixNameBackReference, c is first used for the parsed config (getDefaultConfig()), then re-declared inside the loop as the referral-candidate subset (SubsetThatCouldBeReferencedByResource). This shadowing makes the code harder to follow and easy to misread. Rename one of these (e.g., cfg for the config and candidates for the subset) to avoid shadowing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions/go/ensure-name-substring/ensure_name_substring.go Outdated
Comment thread functions/go/ensure-name-substring/ensure_name_substring.go
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@efiacor
Copy link
Copy Markdown
Collaborator

efiacor commented Apr 30, 2026

Plan is to bump to 1.26.2 on kpt and sdk. Should we do the same here? Also, we should prob bump all at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants