-
Notifications
You must be signed in to change notification settings - Fork 270
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
base: main
Are you sure you want to change the base?
Conversation
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]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awels wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the github query I could come up - https://github.com/search?q=%2F%5C.Watch.*%5C.ResourceQuota%5C%7B%2F&type=code
/retest |
What this PR does / why we need it:
Pending
DataVolumes
which failed to createPVC
due to exceeded quota in the namespace, were not reconciled even if theResourceQuota
was increased or deleted.Which issue(s) this PR fixes:
Fixes #
Release note: