Closed leonardoce closed 1 month ago
Please rebase.
Done @xing-yang
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: leonardoce, xing-yang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR makes the controller process newly created default VolumeSnapshotClasses and VolumeGroupSnapshotClasses, correctly using them or raising an error when appropriate.
Which issue(s) this PR fixes:
Fixes #1099
Special notes for your reviewer:
The controller is using an informer to get VolumeGroupSnapshotClasses and VolumeSnapshotClasses. Unfortunately, objects returned by that will not have the API Kind info set (see https://github.com/kubernetes/client-go/issues/308).
This prevented the
IsDefaultAnnotation
function from working correctly.This patch avoids relying on the object Kind to know whether a VolumeGroupSnapshotClass or a VolumeSnapshotClass is set as default.
The semantics of the
groupsnapshot.storage.kubernetes.io/is-default-class
have been preserved, withtrue
being true and everything else beingfalse
(this is slightly different from Kubernetes).Does this PR introduce a user-facing change?: