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

After the Jobs are stopped, Job PodTemplate Labels are not restored only during unit testing #3082

Closed
tenzen-y opened this issue Sep 17, 2024 · 5 comments
Assignees
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@tenzen-y
Copy link
Member

What happened:
Only during unit testing, the Job PodTemplate Labels (.spec.template.labels) are not restored.
But, during integration testing and actual cluster running, they are restored after the Jobs are suspended.

What you expected to happen:
The Job PodTemplate Labels are always restored after the Jobs are stopped.

How to reproduce it (as minimally and precisely as possible):
We can see the reproduced PR and CI logs there:

Anything else we need to know?:
We verify if those labels (.spec.template.labels) are restored only during the integration testing, and the testing always successful:

ginkgo.By("verify the PodSetUpdates are restored", func() {
// In case of batch/Job the stop is done with multiple API calls, suspended=true being
// done before the info restoration. We should retry the read if the Info is not restored.
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sClient.Get(ctx, *jobLookupKey, createdJob)).Should(gomega.Succeed())
g.Expect(createdJob.Spec.Template.Annotations).ShouldNot(gomega.HaveKey("ann1"))
g.Expect(createdJob.Spec.Template.Annotations).Should(gomega.HaveKeyWithValue("old-ann-key", "old-ann-value"))
g.Expect(createdJob.Spec.Template.Labels).ShouldNot(gomega.HaveKey("label1"))
g.Expect(createdJob.Spec.Template.Labels).Should(gomega.HaveKeyWithValue("old-label-key", "old-label-value"))
g.Expect(createdJob.Spec.Template.Spec.NodeSelector).ShouldNot(gomega.HaveKey(instanceKey))
g.Expect(createdJob.Spec.Template.Spec.NodeSelector).ShouldNot(gomega.HaveKey("selector1"))
}, util.Timeout, util.Interval).Should(gomega.Succeed())

Environment:

  • Kubernetes version (use kubectl version):
  • Kueue version (use git describe --tags --dirty --always):
  • Cloud provider or hardware configuration:
  • OS (e.g: cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@tenzen-y tenzen-y added the kind/bug Categorizes issue or PR as related to a bug. label Sep 17, 2024
@mszadkow
Copy link
Contributor

/assign

@mszadkow
Copy link
Contributor

@tenzen-y please have a look at my explanation here: https://github.com/kubernetes-sigs/kueue/pull/3081/files#r1766613892

@tenzen-y
Copy link
Member Author

tenzen-y commented Oct 2, 2024

@tenzen-y please have a look at my explanation here: https://github.com/kubernetes-sigs/kueue/pull/3081/files#r1766613892

As I commented the above PR, this is my misunderstanding.
@mszadkow Thank you for the investigation, again!
/close

@k8s-ci-robot
Copy link
Contributor

@tenzen-y: Closing this issue.

In response to this:

@tenzen-y please have a look at my explanation here: https://github.com/kubernetes-sigs/kueue/pull/3081/files#r1766613892

As I commented the above PR, this is my misunderstanding.
@mszadkow Thank you for the investigation, again!
/close

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-sigs/prow repository.

@tenzen-y
Copy link
Member Author

tenzen-y commented Oct 2, 2024

/remove-kind bug
/kind support

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

3 participants