Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle empty namespace as default #5430

Conversation

stormqueen1990
Copy link
Member

Changes

Update the namespace handling in the edit add configmap/edit add secret commands to handle the empty namespace as if default was specified.

Before this change, if configMapGenerators/secretGenerators were created using kustomize edit add where one command was issued with default as the namespace and another without a namespace specified, Kustomize created two separate configMapGenerators/secretGenerators, and then failed during kustomize build if the strategy didn't merge both.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 4, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 4, 2023
@stormqueen1990
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 4, 2023
kustomize/commands/internal/util/util_test.go Outdated Show resolved Hide resolved
kustomize/commands/edit/add/configmap_test.go Show resolved Hide resolved
kustomize/go.mod Outdated Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

@ncapps ncapps left a comment

Choose a reason for hiding this comment

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

Should the changes to go.work.sum be removed as well?

The code changes for the fix lgtm - though I am not an official reviewer.

@natasha41575
Copy link
Contributor

/lgtm

Thanks for the fix, code changes LGTM. Please ping me for approval once you confirm from @ncapps's comment above if the go.work.sum file is correctly updated

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 10, 2023
Update the namespace handling in the edit add configmap and secret commands to
handle the empty namespace and the default namespace in the same way. Before
this change, if a configmap/secret was created using kustomize edit add where
one command was issued with default as the namespace and the other without a
namespace specified it would create two separate configmap generators, and then
kustomize build would fail if merge was not the strategy for either.
Run go mod tidy to remove references of golang.org/x/exp, that was used during
development but later removed.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2023
@stormqueen1990
Copy link
Member Author

Should the changes to go.work.sum be removed as well?

The code changes for the fix lgtm - though I am not an official reviewer.

I've undone the changes to go.work.sum (I think those were added by an implicit go work sync done by my IDE).

Revert changes made to go.work.sum, since they don't pertain to code changed in
this PR.
Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natasha41575, stormqueen1990

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2023
@k8s-ci-robot k8s-ci-robot merged commit 265195c into kubernetes-sigs:master Nov 15, 2023
9 checks passed
@ncapps ncapps mentioned this pull request Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

None yet

5 participants