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

feat: edit set secret #5467

Merged

Conversation

stormqueen1990
Copy link
Member

@stormqueen1990 stormqueen1990 commented Nov 29, 2023

  • Add new functionality to allow editing a secret in a kustomization file. Initial implementation supports only --from-literal option.
  • Refactor edit set configmap to reuse some testing bits.

Fixes #4493

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 29, 2023
@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.

@stormqueen1990 stormqueen1990 marked this pull request as draft November 29, 2023 04:36
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 29, 2023
@stormqueen1990 stormqueen1990 marked this pull request as ready for review December 18, 2023 02:27
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 18, 2023
Copy link
Member

@charles-chenzz charles-chenzz left a comment

Choose a reason for hiding this comment

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

only some minor non-blocking comments, btw the test util was clean!

kustomize/commands/edit/set/all.go Outdated Show resolved Hide resolved
Use: "secret NAME [--from-literal=key1=value1] [--namespace=namespace-name] [--new-namespace=new-namespace-name]",
Short: fmt.Sprintf("Edits the value for an existing key for a secret in the %s file", konfig.DefaultKustomizationFileName()),
Long: fmt.Sprintf(`Edits the value for an existing key in an existing secret in the %s file.
Both secret name and key name must exist for this command to succeed.`, konfig.DefaultKustomizationFileName()),
Copy link
Member

Choose a reason for hiding this comment

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

the length of short and long seems like same, can we remove one of them?

Copy link
Member Author

Choose a reason for hiding this comment

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

Long continues on the next line! Do you feel we could add more to it?
I'd prefer to have a more complete description on the long one than scrap it completely.

Copy link
Member

Choose a reason for hiding this comment

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

would prefer more complete in the view of a user

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have an example of the format you'd like to see?

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.

Nice consolidation with the test util.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 17, 2024
@koba1t
Copy link
Member

koba1t commented Jan 17, 2024

It looks like the test failed in CI. Could you investigate and fix it?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2024
@stormqueen1990
Copy link
Member Author

It looks like the test failed in CI. Could you investigate and fix it?

Hi there @koba1t! It looks like that was a flake and it went away after I rebased. This is ready for a new look 🙂

Copy link
Member

@koba1t koba1t left a comment

Choose a reason for hiding this comment

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

Hi, @stormqueen1990!
Thanks for your work!

I'm sorry for the delay in my review.
I added a few comments. Could you check that?

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2024
* Add new functionality to allow editing a secret in a kustomization file. Initial
  implementation supports only --from-literal option.
* Refactor edit set configmap to reuse some testing bits.
Remove error checks from the utility function and bubble them up instead.
Add a blurb to the help output for both 'edit set configmap' and 'edit set secret'
to clarify that whenever a namespace is not specified, the default namespace is
implicitly defined as part of the commands.
@koba1t
Copy link
Member

koba1t commented Feb 8, 2024

Thanks for your contribution!

/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 Feb 8, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t, 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 merged commit b154361 into kubernetes-sigs:master Feb 8, 2024
9 checks passed
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

Support edit set configmap
5 participants