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

Move Pod labels and annotation to separate package. #4472

Conversation

mbobrovskyi
Copy link
Contributor

@mbobrovskyi mbobrovskyi commented Mar 4, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Move Pod labels and annotation to separate package.

Which issue(s) this PR fixes:

Part of #3653

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 4, 2025
@k8s-ci-robot k8s-ci-robot requested review from mimowo and tenzen-y March 4, 2025 09:03
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 4, 2025
Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 63b67ec
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67c6d9f921e99f0008c00274

@mbobrovskyi mbobrovskyi force-pushed the cleanup/move-pod-group-labels-and-annotations branch from 897a1e2 to d0d2c0d Compare March 4, 2025 09:04
@mbobrovskyi
Copy link
Contributor Author

/cc @PBundyra

@k8s-ci-robot k8s-ci-robot requested a review from PBundyra March 4, 2025 09:04
@mbobrovskyi mbobrovskyi force-pushed the cleanup/move-pod-group-labels-and-annotations branch from d0d2c0d to 63b67ec Compare March 4, 2025 10:46
Copy link
Member

Choose a reason for hiding this comment

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

If we put these constants in pkg/controller/jobs/pod, there are cycle imports, right?
If yes, could you point out the place for cycle imports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the labels and annotations in pkg/util/testingjobs/pod/wrappers.go to use constants instead:

func (p *PodWrapper) PodGroupServingAnnotation(enabled bool) *PodWrapper {
return p.Annotation("kueue.x-k8s.io/pod-group-serving", strconv.FormatBool(enabled))
}
// RoleHash updates the pod.RoleHashAnnotation of the pod
func (p *PodWrapper) RoleHash(h string) *PodWrapper {
return p.Annotation("kueue.x-k8s.io/role-hash", h)
}
// KueueSchedulingGate adds kueue scheduling gate to the Pod
func (p *PodWrapper) KueueSchedulingGate() *PodWrapper {
return p.Gate("kueue.x-k8s.io/admission")
}

However, this introduced circular dependencies. To resolve this, I moved the code into a separate package.

Copy link
Member

Choose a reason for hiding this comment

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

That sounds reasonable.

Copy link
Member

Choose a reason for hiding this comment

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

What is the cause for these manifest changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't change +kubebuilder markers. I think it happens after moving constants to separate package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I can see, the changes only involve reordering the code.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Anyway, it seems not to change manifests except for orders.

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Thank you!
/lgtm
/approve

Copy link
Member

Choose a reason for hiding this comment

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

That sounds reasonable.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Anyway, it seems not to change manifests except for orders.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 48d4a423ce61a43877767afb270531158aa6317c

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mbobrovskyi, tenzen-y

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit 907c384 into kubernetes-sigs:main Mar 7, 2025
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.11 milestone Mar 7, 2025
@mbobrovskyi mbobrovskyi deleted the cleanup/move-pod-group-labels-and-annotations branch March 7, 2025 22:38
kannon92 pushed a commit to openshift/kubernetes-sigs-kueue that referenced this pull request Mar 13, 2025
kannon92 pushed a commit to openshift/kubernetes-sigs-kueue that referenced this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants