kustomize
kustomize copied to clipboard
Fix name in a configMapRef missing hash #5047
Fixes https://github.com/kubernetes-sigs/kustomize/issues/5047.
Until https://github.com/kubernetes-sigs/kustomize/pull/3529, an empty prefix/suffix was considered to have the same SameEndingSubSlice
(previously named SameEndingSubarray
) as a one element prefix/suffix.
This allowed the example in https://github.com/kubernetes-sigs/kustomize/issues/5047 (added as a test case in this PR), which has no longer worked since v3.9.3.
This PR adds back support for this behaviour, by making two passes in selectReferral
:
- If a prefix/suffix is empty, then it vacuously matches anything (i.e
allowEmpty = true
). Unlike before it also doesn't matter how many elements are in the non-empty prefix/suffix.
If there is still more than one candidate, then
- Fall back to the current behaviour, requiring an exact match of the prefix and suffix (i.e.
allowEmpty = false
).
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.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: jonathanlking / name: Jonathan King (e052771eeaabdebabc8f298411950e2647560ba6, 534ac517c95a0df8dbf8e605028dc56f93d3da78, 8e03a67aad1b64c80ac1d6e4ab1843e695cdcb3a, d146a81c723e8fcc8df73a6f1cceb71685d6da74, 218e3eac681be251318f5820c333a7ccccd1b1bb, d6f988a528c3552540743ff2c926e920b0980ef8, 12ad89b2d63c9623d8e49838d08aa30c600eedd9)
Welcome @jonathanlking!
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. :smiley:
Hi @jonathanlking. 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.
I think this is ready to review. The approach I’ve taken is described in https://github.com/kubernetes-sigs/kustomize/issues/5047#issuecomment-1627542060. (The reason I left this as a draft until now was I was uncertain whether this was a correct approach to take, and wanted to leave the PR review process as more of a code review, but I’m not sure if this actually makes sense!)
Just seen the failing Go / Lint action, I'll try and fix this now.
need this fix badly
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
/ok-to-test
I've just rebased off master and hopefully (actually this time!) fixed the linting failures 🤞
Apologies for the noise, I'm pretty sure the lint step is now working (I've run the CI job on my own fork).
/assign
Thanks @jonathanlking /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jonathanlking, koba1t
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [koba1t]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
Thank you both @stormqueen1990 and @koba1t for the reviews and getting this merged! ☺️ 🙏