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 edit set image to parse both tag and digest #5234

Merged

Conversation

blackjid
Copy link
Contributor

@blackjid blackjid commented Jul 5, 2023

Ref. #4713

Add support to pass both tag and digest to edit set image command

kustomize edit set image org/repo:tag@sha256:digest
kustomize edit set image myimage=org/repo:tag@sha256:digest

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 5, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: blackjid / name: Juan Ignacio Donoso (a85dfd4)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jul 5, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @blackjid!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 5, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @blackjid. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 5, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 5, 2023
Copy link

@FrenchBen FrenchBen left a comment

Choose a reason for hiding this comment

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

LGTM

@blackjid
Copy link
Contributor Author

/assign @KnVerey @natasha41575 @koba1t

@blackjid
Copy link
Contributor Author

/unassign @KnVerey @natasha41575 @koba1t

@blackjid
Copy link
Contributor Author

/cc @KnVerey @natasha41575 @koba1t

@natasha41575
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 18, 2023
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.

Thanks for your PR!

I added a few nit comments. Please check!

kustomize/commands/edit/set/setimage.go Show resolved Hide resolved
kustomize/commands/edit/set/setimage.go Show resolved Hide resolved
@blackjid blackjid force-pushed the bug_fix_set_image_digest_and_tag branch from 716a102 to 7b75259 Compare September 7, 2023 16:59
@k8s-ci-robot k8s-ci-robot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 7, 2023
@varshaprasad96
Copy link
Member

varshaprasad96 commented Sep 27, 2023

@blackjid The intention of merging that PR was not to expose the APIs to the users that was being utilized just in api/ pkg. Since this PR only uses the helpers from image.Split (https://github.com/kubernetes-sigs/kustomize/pull/5234/files#diff-e1479ff375265cef6afbc0cc7c326e7e6cc2a89e37f8c83c9b8e81bea788ab54R218) could we move that logic into util (a new pkg under api/pkg/util), and call it at both the places. Thoughts?

Let me know if I'm missing anything else in the use of image pkg. If needed we can expose it again, but I would vote for not entirely exposing it, if we want to use just a helper method.

@blackjid blackjid force-pushed the bug_fix_set_image_digest_and_tag branch from 26988e8 to b8015ed Compare September 27, 2023 19:46
@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.

@blackjid
Copy link
Contributor Author

/test all

@blackjid blackjid force-pushed the bug_fix_set_image_digest_and_tag branch from b8015ed to 1a05794 Compare September 27, 2023 20:42
@blackjid
Copy link
Contributor Author

blackjid commented Sep 27, 2023

could we move that logic into util (a new pkg under api/pkg/util), and call it at both the places. Thoughts?

@varshaprasad96 That sounds good.., I have made the changes... let me know if there is something missing, or some change needed...

@blackjid
Copy link
Contributor Author

Do you prefer to use the new util to replace the direct call here also?? https://github.com/kubernetes-sigs/kustomize/blob/master/api/filters/imagetag/updater.go#L34
even if it is not necesary as the call is made inside the api package?

@natasha41575
Copy link
Contributor

@varshaprasad96 can you take another look at this PR to check if your comments are addressed?

/assign @varshaprasad96

@blackjid
Copy link
Contributor Author

😢

@varshaprasad96
Copy link
Member

/retest

@varshaprasad96
Copy link
Member

/test all

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

@blackjid Really sorry for missing this PR. The changes look good to me.

I've kicked the CI to re-trigger the linter tests. Could you please address those. Once they pass this should be good to merge.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 26, 2024
@varshaprasad96
Copy link
Member

Looks like the CI is not being triggered. @blackjid could you please close and re-open and PR to see if this works. I don't have permissions to do it.

@blackjid blackjid closed this Jan 26, 2024
@blackjid blackjid reopened this Jan 26, 2024
@varshaprasad96
Copy link
Member

@koba1t @natasha41575 could you please approve the workflow runs? Looks like I don't have permissions for it.

@blackjid blackjid force-pushed the bug_fix_set_image_digest_and_tag branch from 1a05794 to a85dfd4 Compare January 26, 2024 19:31
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 26, 2024
@blackjid
Copy link
Contributor Author

@varshaprasad96 I've fixed the linter magic numbers issues.

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/lgtm

Once the CI is triggered and run is successful, it would be added to the merge queue.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: blackjid, FrenchBen, varshaprasad96

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 6982666 into kubernetes-sigs:master Jan 26, 2024
4 checks passed
@blackjid blackjid deleted the bug_fix_set_image_digest_and_tag branch January 26, 2024 22:34
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Development

Successfully merging this pull request may close these issues.

7 participants