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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't skip evicting pods with same name but in different namespace #746

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

johngmyers
Copy link
Contributor

Issue #, if available:

None

Description of changes:

When draining a node, NTH skips evicting itself. It incorrectly skipped evicting pods in other namespaces that happened to have the same name.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@johngmyers johngmyers requested a review from a team as a code owner December 10, 2022 22:34
@johngmyers
Copy link
Contributor Author

The check failure appears to be a flake.

@snay2
Copy link
Contributor

snay2 commented Dec 14, 2022

Can you open an issue with more details about what is happening and why? I'm not sure I understand the usecase or how common it is. We try to be judicious about adding new configuration options to NTHv1 because it already has so many.

@johngmyers
Copy link
Contributor Author

johngmyers commented Dec 15, 2022

The NTH Helm chart already passes in the NAMESPACE environment variable, but NTH doesn't reference it. Since the value is already available, correctness is preferable.

If it is desired to work less correctly without the setting, the condition could be written as pod.Name == podName && (pod.Namespace == podNamespace || podNamespace == "")

@snay2
Copy link
Contributor

snay2 commented Dec 16, 2022

That's good to know. If the environment variable is already in the Helm chart, then this seems like a reasonable thing to include.

I'm in favor of including the || podNamespace == "" condition to improve backwards compatibility.

Copy link
Contributor

@snay2 snay2 left a comment

Choose a reason for hiding this comment

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

LGTM

@snay2 snay2 removed their assignment Dec 17, 2022
@snay2 snay2 merged commit 01f4844 into aws:main Dec 22, 2022
@johngmyers johngmyers deleted the namespace-config branch December 22, 2022 19:36
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.

None yet

2 participants