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

Use the same processors for all currently supported provisioning classes #6873

Merged

Conversation

aleksandra-malinowska
Copy link
Contributor

What this PR does / why we need it:

Refactor that removes CombinedProcessor (we don't need separate processors for any currently envisioned provisioning classes) and adds a source-of-truth for supported provisioning classes.

The only change in behavior is including best-effort-atomic provisioning class as supported in now generic provisioning requests processor.

Which issue(s) this PR fixes:

Issue: #6815

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/provisioning-request.md

/cc @yaroslava-serdiuk

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/cluster-autoscaler labels May 27, 2024
@aleksandra-malinowska
Copy link
Contributor Author

@yaroslava-serdiuk please confirm if lack of validation in injector was intentional, I'll add it if it was a bug.

@yaroslava-serdiuk
Copy link
Contributor

Thanks for the changes!
Let's update the main as well:

provreqProcesor := provreq.NewCombinedProvReqProcessor(client, []provreq.ProvisioningRequestProcessor{checkcapacity.NewCheckCapacityProcessor(client)})

Otherwise /lgtm

@yaroslava-serdiuk
Copy link
Contributor

/lgtm

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

/cc @towca

@k8s-ci-robot k8s-ci-robot requested a review from towca May 29, 2024 07:41
@yaroslava-serdiuk
Copy link
Contributor

Yaroslava Serdiuk please confirm if lack of validation in injector was intentional, I'll add it if it was a bug.

Sorry for late reply, I just realised that this is a bug and we actually should add validation in injector.
If it's ok for you, can you add it in this PR? Otherwise I can add it later in separate PR.

@yaroslava-serdiuk
Copy link
Contributor

/assign @x13n

@aleksandra-malinowska
Copy link
Contributor Author

Sorry for late reply, I just realised that this is a bug and we actually should add validation in injector.
If it's ok for you, can you add it in this PR? Otherwise I can add it later in separate PR.

Let's merge this and add it later (preferably using the map introduced in this PR as source-of-truth).

@aleksandra-malinowska
Copy link
Contributor Author

/uncc @towca
/cc @x13n

@k8s-ci-robot k8s-ci-robot requested review from x13n and removed request for towca June 4, 2024 11:52
// -BookingExpired condition for Provisioned ProvisioningRequest if capacity reservation time is expired.
// -Failed condition for ProvisioningRequest that were not provisioned during defaultExpirationTime.
// TODO(yaroslava): fetch reservation and expiration time from ProvisioningRequest
func (p *provReqProcessor) Process(provReqs []*provreqwrapper.ProvisioningRequest) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@x13n just to clarify, most of this code is being moved from cluster-autoscaler/provisioningrequest/checkcapacity/processor.go (adding comment as the diff doesn't render it clearly)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I noticed, ended up copying both files and running a diff locally :)

@x13n
Copy link
Member

x13n commented Jun 6, 2024

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleksandra-malinowska, x13n

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 Jun 6, 2024
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 6, 2024
@yaroslava-serdiuk
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 6, 2024
@k8s-ci-robot k8s-ci-robot merged commit 34690b1 into kubernetes:master Jun 6, 2024
6 checks passed
@yaroslava-serdiuk
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.30

@k8s-infra-cherrypick-robot

@yaroslava-serdiuk: #6873 failed to apply on top of branch "cluster-autoscaler-release-1.30":

Applying: Use the same processors for all currently supported provisioning classes
Using index info to reconstruct a base tree...
M	cluster-autoscaler/main.go
M	cluster-autoscaler/provisioningrequest/conditions/conditions.go
Falling back to patching base and 3-way merge...
Auto-merging cluster-autoscaler/provisioningrequest/conditions/conditions.go
CONFLICT (content): Merge conflict in cluster-autoscaler/provisioningrequest/conditions/conditions.go
Removing cluster-autoscaler/provisioningrequest/checkcapacity/processor.go
Auto-merging cluster-autoscaler/main.go
CONFLICT (content): Merge conflict in cluster-autoscaler/main.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use the same processors for all currently supported provisioning classes
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick cluster-autoscaler-release-1.30

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.

@yaroslava-serdiuk
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.30

@k8s-infra-cherrypick-robot

@yaroslava-serdiuk: #6873 failed to apply on top of branch "cluster-autoscaler-release-1.30":

Applying: Use the same processors for all currently supported provisioning classes
Using index info to reconstruct a base tree...
M	cluster-autoscaler/main.go
Falling back to patching base and 3-way merge...
Removing cluster-autoscaler/provisioningrequest/checkcapacity/processor.go
Auto-merging cluster-autoscaler/main.go
CONFLICT (content): Merge conflict in cluster-autoscaler/main.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use the same processors for all currently supported provisioning classes
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick cluster-autoscaler-release-1.30

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.

@yaroslava-serdiuk
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.30

@k8s-infra-cherrypick-robot

@yaroslava-serdiuk: new pull request created: #7051

In response to this:

/cherry-pick cluster-autoscaler-release-1.30

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.

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. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants