-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
fix node.labels leak in scheduler predicates e2e #26886
fix node.labels leak in scheduler predicates e2e #26886
Conversation
@@ -529,6 +528,14 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() { | |||
labelPod, err := c.Pods(ns).Get(labelPodName) | |||
framework.ExpectNoError(err) | |||
Expect(labelPod.Spec.NodeName).To(Equal(nodeName)) | |||
|
|||
By("removing the label " + k + " off the node " + nodeName) |
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.
can you wrap this into a function?
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.
probably also worth doing this in a defer
, as otherwise it will only run on success.
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.
(or maybe in afterEach
?)
I agree with both of @gmarek's comments. |
@@ -125,6 +125,24 @@ func cleanupPods(c *client.Client, ns string) { | |||
} | |||
} | |||
|
|||
func removeLabelOffNode(c *client.Client, nodeName string, labelKey string) { | |||
By("removing the label " + labelKey + " off the node " + nodeName) | |||
framework.RunKubectlOrDie("label", "nodes", nodeName, labelKey+"-") |
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.
Can you please do ordinary update? Let's not depend on kubectl in this test.
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.
Oops, this line should be removed.
The lines following are in the way ordinary update.
54c1a0a
to
6c335b9
Compare
@gmarek squashed, PTAL |
LGTM Thanks! I'll let @gmarek apply the LGTM label if he's satisfied with the changes |
GCE e2e build/test passed for commit 6c335b9. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 6c335b9. |
Automatic merge from submit-queue |
closes #26698
cc @davidopp @wojtek-t @fejta @gmarek