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

Support Cohorts with Resources in cache/hierarchy packages #2939

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

gabesaba
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Update cache to support Cohorts with resources. Update hierarchy to support explicit Cohorts. Part of #79

Special notes for your reviewer:

commit 1 : move files and refactor parsing
commit 2: support Cohorts which provide resources in cache. support explicit Cohorts in hierarchy

Users cannot use this functionality until we wire up reconciler and webhook. In the interest of keeping PRs small, I will publish those in separate PRs.

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/feature Categorizes issue or PR as related to a new feature. labels Aug 30, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 30, 2024
Copy link

netlify bot commented Aug 30, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit bcdebab
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/66d6c97d2c493400084cf660

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 30, 2024
@gabesaba
Copy link
Contributor Author

/assign @macsko

wantCohorts: sets.New("cohort"),
wantCqs: sets.New("queue"),
wantCqEdge: []cqEdge{{"queue", "cohort"}},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

What about testing the cleanupCohort method? Like:

m.AddCohort(newCohort("cohort"))
m.AddClusterQueue(newCq("queue"))
m.UpdateClusterQueueEdge("queue", "cohort")
m.DeleteCohort("cohort")
m.DeleteClusterQueue("queue")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

}

// rewireChildren is used when we are changing a Cohort
// from an implicit to an explcit Cohort, or vice-versa.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: explcit -> explicit

defer c.Unlock()
c.hm.DeleteCohort(apiCohort.Name)

// if the cohort still exists after deletion, it means
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: start with upper case

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 3, 2024
@macsko
Copy link
Contributor

macsko commented Sep 3, 2024

/lgtm

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

LGTM label has been added.

Git tree hash: 5c6066569fcfec1b165141c8c4c496c8ae093556

@@ -57,6 +57,9 @@ issues:
- staticcheck
# TODO(#768): Drop when incrementing the API version.
text: "SA1019: constants.QueueAnnotation is deprecated"
- linters:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tracking here: #2965

@gabesaba
Copy link
Contributor Author

gabesaba commented Sep 3, 2024

/assign @mimowo

Copy link
Contributor

@mimowo mimowo left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabesaba, mimowo

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 Sep 3, 2024
@k8s-ci-robot k8s-ci-robot merged commit 82b8317 into kubernetes-sigs:main Sep 3, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.9 milestone Sep 3, 2024
@gabesaba gabesaba deleted the cache_resource_cohort branch September 3, 2024 14:04
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/feature Categorizes issue or PR as related to a new feature. 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.

4 participants