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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kubernetes-client): Match context & cluster names exactly #948

Merged
merged 1 commit into from Nov 8, 2023

Conversation

zerok
Copy link
Contributor

@zerok zerok commented Nov 8, 2023

Fixes #947

Looks like the context and cluster names are not yet matched exactly within the ContextFromName function (and the cluster name is not matched exactly in other places). This PR changes that.

This only leads to mis-matches if there are name candidates where the expected name is a suffix of others and at least one of these is lexically sorted before the expected name:

expected: docker
candidates:
- docker
- abc-docker
- bcd-docker
match: abc-docker (because lexcially before docker and has expected name as substring)

vs.

expected: docker
candidates:
- docker
- test-docker
- dummy-docker
match: docker

I'm not sure if the endpoint in IPFromContext should also be matched exactly and so I didn't touch that one yet 馃檪

Copy link

github-actions bot commented Nov 8, 2023

PR Preview Action v1.4.4
Preview removed because the pull request was closed.
2023-11-08 13:38 UTC

Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

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

That LGTM. I think I attempted this fix and missed some here: #750

@zerok
Copy link
Contributor Author

zerok commented Nov 8, 2023

Thanks 馃檪 I hope I didn't break anything ^_^

@zerok zerok merged commit 05f71fe into main Nov 8, 2023
8 checks passed
@zerok zerok deleted the zerok/fix-context-from-name-matching branch November 8, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tk using wrong kubeconfig context
2 participants