-
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
[address #4717] Re-do create template/metadata when using includeTemplates if not present #4805
Conversation
@aibarbetta: 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. |
Hi @aibarbetta. 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. |
The full set of specs you'll need can be extracted from the CommonLabels config here. Look specifically at paths that end in |
Thanks for the help @KnVerey! Changes are done, I added some tests for the rest of the types and they all pass. Can I get an ok-to-test to run the full suite here? |
/ok-to-test |
@KnVerey make lint runs successfully now, can we retest? 🙏🏻 |
@@ -7,6 +7,7 @@ import ( | |||
"log" | |||
"sort" | |||
|
|||
"github.com/pkg/errors" |
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.
"github.com/pkg/errors"
looks like an already unmaintained and archived.
Could you think of using fmt.Errorf()
instead of errors.Wrap()
if you don't have any reason?
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.
"github.com/pkg/errors"
looks like an already unmaintained and archived.Could you think of using
fmt.Errorf()
instead oferrors.Wrap()
if you don't have any reason?
done! thanks for making me aware of that
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.
FYI the other errors package we often use in Kustomize is our own "sigs.k8s.io/kustomize/kyaml/errors", which provides errors.WrapPrefixf(err, msg, args...)
for situations like these. We have plenty of fmt.Errorf
usage as well though, so I don't feel strongly about this.
@KnVerey linter fix is done, can we retest? |
/test all |
Nice work! I have a couple very minor suggestions and will put a hold in case you want to take them (otherwise the bot will auto-merge immediately). /hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aibarbetta, KnVerey 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 |
Hi @KnVerey sure, please send me the suggestions |
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.
Seems like I accidentally didn't click the submit button on this review. Sorry for the confusion!
api/krusty/inlinelabels_test.go
Outdated
app.kubernetes.io/component: a | ||
app.kubernetes.io/instance: b | ||
app.kubernetes.io/name: c | ||
app.kubernetes.io/part-of: d |
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.
Suggestion: for these extra Kinds tests, start with fewer labels to make it easier to see the before/after. In particular, I was confused at first because this test is starting with the exact same labels that are added by the transformer in the other tests.
@@ -7,6 +7,7 @@ import ( | |||
"log" | |||
"sort" | |||
|
|||
"github.com/pkg/errors" |
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.
FYI the other errors package we often use in Kustomize is our own "sigs.k8s.io/kustomize/kyaml/errors", which provides errors.WrapPrefixf(err, msg, args...)
for situations like these. We have plenty of fmt.Errorf
usage as well though, so I don't feel strongly about this.
Co-authored-by: Katrina Verey <[email protected]>
Thanks for the suggestions @KnVerey! all done :) |
/unhold Thank you for all your work on this one! |
Hi all, I'm attempting to re-do #4751 to fix #4717, I added a new test to reproduce the bug the old PR had.
It's not clear to me how can I add resource-specific fieldspecs for the
includeTemplates
flag in the labels plugin (as @KnVerey and @wolfmah mentioned here and here), can anyone provide some guidance?Thanks!