kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

Fix name in a configMapRef missing hash #5047

Open jonathanlking opened this issue 1 year ago • 14 comments

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:

  1. 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

  1. Fall back to the current behaviour, requiring an exact match of the prefix and suffix (i.e. allowEmpty = false).

jonathanlking avatar Jul 07 '23 00:07 jonathanlking

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.

k8s-ci-robot avatar Jul 07 '23 00:07 k8s-ci-robot

CLA Signed

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:

k8s-ci-robot avatar Jul 07 '23 00:07 k8s-ci-robot

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.

k8s-ci-robot avatar Jul 07 '23 00:07 k8s-ci-robot

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!)

jonathanlking avatar Oct 14 '23 14:10 jonathanlking

Just seen the failing Go / Lint action, I'll try and fix this now.

jonathanlking avatar Nov 02 '23 14:11 jonathanlking

need this fix badly

ubyyj avatar Nov 14 '23 10:11 ubyyj

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

k8s-triage-robot avatar Feb 12 '24 10:02 k8s-triage-robot

/remove-lifecycle stale

jonathanlking avatar Feb 12 '24 10:02 jonathanlking

/ok-to-test

erikgb avatar Feb 29 '24 21:02 erikgb

I've just rebased off master and hopefully (actually this time!) fixed the linting failures 🤞

jonathanlking avatar Mar 06 '24 23:03 jonathanlking

Apologies for the noise, I'm pretty sure the lint step is now working (I've run the CI job on my own fork).

jonathanlking avatar Mar 07 '24 02:03 jonathanlking

/assign

koba1t avatar Mar 13 '24 18:03 koba1t

Thanks @jonathanlking /approve

koba1t avatar Apr 02 '24 19:04 koba1t

[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

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 avatar Apr 02 '24 19:04 k8s-ci-robot

Thank you both @stormqueen1990 and @koba1t for the reviews and getting this merged! ☺️ 🙏

jonathanlking avatar Apr 02 '24 19:04 jonathanlking