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

Watch for ResourceQuota updates to reconcile DVs #3601

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arnongilboa
Copy link
Collaborator

What this PR does / why we need it:
Pending DataVolumes which failed to create PVC due to exceeded quota in the namespace, were not reconciled even if the ResourceQuota was increased or deleted.

Which issue(s) this PR fixes:
Fixes #

Release note:

Watch for ResourceQuota updates to reconcile Pending DataVolumes

Pending DataVolumes which failed to create PVC due to exceeded quota
in the namespace, were not reconciled even if the ResourceQuota was
increased or deleted.

Signed-off-by: Arnon Gilboa <[email protected]>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jan 16, 2025
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aglitke for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Collaborator

@akalenyu akalenyu left a comment

Choose a reason for hiding this comment

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

bit concerned about watching these cluster wide

@@ -335,6 +335,28 @@ func addDataVolumeControllerCommonWatches(mgr manager.Manager, dataVolumeControl
}
}

// Watch for ResourceQuota updates to reconcile the pending DVs which exceeded the quota
if err := dataVolumeController.Watch(source.Kind(mgr.GetCache(), &corev1.ResourceQuota{}, handler.TypedEnqueueRequestsFromMapFunc[*corev1.ResourceQuota](
func(ctx context.Context, rq *corev1.ResourceQuota) []reconcile.Request {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wish the PVCs got created and just not bind instead of us having to watch this resource
Since it's a bit out of scope for CDI to know about these

With that said, I think these are not large like configmaps so it might be fine
@mhenriks WDYT?

Copy link
Collaborator Author

@arnongilboa arnongilboa Jan 16, 2025

Choose a reason for hiding this comment

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

I wish the PVCs got created and just not bind instead of us having to watch this resource

I totally agree, but unfortunately that's not the current k8s behavior. It rejects such PVC creation in the admission control phase of the API server.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I'm just not sure we want to be the first/only controller to watch those

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@awels wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@awels
Copy link
Member

awels commented Jan 16, 2025

/retest

@coveralls
Copy link

Coverage Status

coverage: 59.354% (-0.05%) from 59.405%
when pulling 1f27d60 on arnongilboa:watch_resource_quota
into 363d312 on kubevirt:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants