-
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
Run kustomize build with kustomize localize and add a no-verify flag. #5544
Run kustomize build with kustomize localize and add a no-verify flag. #5544
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. |
Welcome @sanaasy! |
Hi @sanaasy. 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 Once the patch is verified, the new status will be reflected by the 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. |
I'm still working on tests for this issue so keeping this in draft! Edit: this is done! |
b32e146
to
a58784b
Compare
a58784b
to
874ec03
Compare
874ec03
to
c576b85
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.
Hello there, @sanaasy! 👋
Thank you very much for your contribution.
With regards to using exec.Command
, I am not sure if I understand the reasoning for choosing it over invoking the build
command function directly, since localize
and build
are relatively co-located in the codebase. Would you mind elaborating on that decision?
Sure! When I first wrote the code, I didn't see that the build command |
Hi there, @sanaasy! Sorry for the delay in responding! I have some concerns with the The scenario I have in mind is something like this:
Please let me know if my understanding is incorrect, or if this scenario doesn't make sense! |
cf48606
to
cc2aff7
Compare
That's a fair callout! I have updated the PR to use the local build commands instead and have verified that things work as expected. If you could take another look please! |
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.
Found a few more bits!
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.
Thank you very much for your contribution! 🙏🏻
/lgtm
/label tide/merge-method-squash |
if localizedBuild == originalBuild { | ||
log.Printf("VERIFICATION SUCCESS: `kustomize build` for %s and %s are the same after localization.\n", args.target, dst) | ||
} else { | ||
log.Println(copyutil.PrettyFileDiff(originalBuild, localizedBuild)) |
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.
log.Println(copyutil.PrettyFileDiff(originalBuild, localizedBuild)) | |
log.Println(copyutil.PrettyFileDiff(originalBuild, localizedBuild)) |
Curious: Is it intentional to add this log statement and explicitly mention the diff?
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.
Yes! This is what the KEP outlined:
The command indicates success if the outputs match and throws an error with a diff summary otherwise.
https://github.com/kubernetes-sigs/kustomize/blob/master/proposals/22-04-localize-command.md
…e localize command is run.
63e5084
to
b679598
Compare
/lgtm |
@sanaasy: you cannot LGTM your own PR. In response to this:
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-sigs/prow repository. |
@kushp: changing LGTM is restricted to collaborators In response to this:
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-sigs/prow repository. |
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
/ok-to-test
/remove-label tide/merge-method-squash |
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.
The changes look good!
@sanaasy Thanks for the contribution!
@stormqueen1990 Thanks for reviewing and following this through! :))
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianh814, sanaasy, 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 |
@stormqueen1990 @varshaprasad96 👋 hello again! After Varsha had approved the PR, it ran into a lint error. I've fixed the line that was too long and split it up using string concatenation and have retested the lint, the build locally and the test files. Could you two have another look? Thank you again! Hopefully this should be the last step. |
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.
Hi @sanaasy, thanks for fixing it!
@varshaprasad96 this will need approval to re-run the workflows after the code change.
/lgtm
Context
Closes issue: #5276
This PR adds functionality to auto-run
kustomize build
when thekustomize localize
command is run. . This will run when--no-verify
is not specified as false by the user or not specified at all when running the localize command. When the--no-verify
flag is added, this check will be skipped.🎩 Tophatted by doing:
make kustomize
~/go/bin/kustomize localize . localized-results
~/go/bin/kustomize localize . localized-results --no-verify
~/go/bin/kustomize localize . localized-results --scope "/Desktop"