-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: edit set configmap #5391
feat: edit set configmap #5391
Conversation
This PR has multiple commits, and the default merge method is: merge. 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. |
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick drive by comments. Overall approach LGTM. I can do a more thorough review once this is taken out of draft state.
kustomize/commands/internal/util/configmapSecretFlagsAndArgs.go
Outdated
Show resolved
Hide resolved
28830c4
to
e0cb8d8
Compare
e0cb8d8
to
5381f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left minor questions and suggestions. I assume the set secret
functionality will be added in a follow up PR?
kustomize/commands/internal/util/configmapSecretFlagsAndArgs_test.go
Outdated
Show resolved
Hide resolved
b93aea8
to
4ec1a7a
Compare
Hi @ncapps! Yes, that's correct. I intend to add |
15b25c6
to
48a1c07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm
/lgtm
I am not an official reviewer but these changes lgtm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stormqueen1990 Thanks for the PR. My reviews are just language specific nits. The general logic seems good :)
/lgtm
kustomize/commands/internal/util/configmapSecretFlagsAndArgs.go
Outdated
Show resolved
Hide resolved
kustomize/commands/internal/util/configmapSecretFlagsAndArgs.go
Outdated
Show resolved
Hide resolved
b03384c
to
b074890
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Minor question and nit.
a368f9f
to
d74bb63
Compare
d74bb63
to
bf3326a
Compare
* Add a new command 'edit set configmap' to allow editing the values of an already-existing configmap in a kustomization file. * Add tests to validate the new feature.
* Include tests to validade the new function ValidateSet, included to do necessary validations when running the 'kustomize edit set configmap' command. * Minor refactorings to use the existing constants in the 'edit set configmap' command. * Add dashes before each item in the comment explaining how ExpandFileSource() works so IDEs don't try to reformat the list and remove the indentation in it. * Because this change mutates the list of literal sources, ensure that both add and set save the resulting list in a predictable order to make it easier to check when new items are added/removed and aid in testing. * Since literal sources are the only bit that's important in this test, verify that the literal sources in the actual result is equal to what we expected it to be.
Use '%q' formatter instead of '%s' to print resource name Co-authored-by: Varsha <varshaprasad96@gmail.com>
* Unexport constant that is used only in the scope of a single function. * Add extra validation to ensure format is correct with one single '=' per key-value pair. * Add extra set of tests to validate format. * Update test case to match new printed format in the error message.
Rename the test package from set_test back to set and unexport functions that do not need to be exported anymore for testing purposes.
Handle the empty and the default namespaces as equal. Add tests to validate this scenario.
bf3326a
to
de2dcaf
Compare
/unhold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
/lgtm
/approve |
[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 |
First pass at implementing the
edit set configmap
command. Initally adding just two flags:--from-literal
and--new-namespace
.Related issue: #4493