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
refactoring: use well known LabelHostname constant #11553
Conversation
115eb50
to
19b1c0c
Compare
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.
Thank you for the cleanup @fossedihelm
nit: There is one more under pkg/virt-handler/node-labeller/cpu_plugin_test.go
.
19b1c0c
to
ffbbd8f
Compare
Thank you! I missed it :) |
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.
Nice, thank you!
@@ -362,7 +362,7 @@ var nodeLabels = map[string]string{ | |||
"hyperv.node.kubevirt.io/tlbflush": "true", | |||
"hyperv.node.kubevirt.io/vpindex": "true", | |||
"kubernetes.io/arch": "amd64", | |||
"kubernetes.io/hostname": "node01", | |||
k8sv1.NamespaceDefault: "node01", |
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.
wrong one 🤦♂️
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.
Good catch!
"kubernetes.io/hostname" is a well known label that we are using as plain string. Switch using the constant provided by k8s. Signed-off-by: fossedihelm <ffossemo@redhat.com>
ffbbd8f
to
3dbf033
Compare
@EdDev @orelmisan Fixed wrong constant and rebased. |
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.
Thank you
@fossedihelm: The following test failed, say
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 understand the commands that are listed here. |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jean-edouard 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 |
Required labels detected, running phase 2 presubmits: |
/retest-required |
1 similar comment
/retest-required |
What this PR does
kubernetes.io/hostname
is a well-known label that we are using as a plain string. Switch using the constant provided by k8s.Before this PR:
kubernetes.io/hostname
is used as a plain stringAfter this PR:
LabelHostname
constant is usedFixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Special notes for your reviewer
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note