Fix detecting default annotation on VolumeGroupSnapshotClass
The `IsDefaultAnnotation()` function has been extended to check for the correct default annotation, taking the Kind of the object into consideration.
This commit is contained in:
@@ -1416,7 +1416,7 @@ func (ctrl *csiSnapshotCommonController) SetDefaultSnapshotClass(snapshot *crdv1
|
||||
|
||||
defaultClasses := []*crdv1.VolumeSnapshotClass{}
|
||||
for _, class := range list {
|
||||
if utils.IsDefaultAnnotation(class.ObjectMeta) && pvDriver == class.Driver {
|
||||
if utils.IsDefaultAnnotation(class.TypeMeta, class.ObjectMeta) && pvDriver == class.Driver {
|
||||
defaultClasses = append(defaultClasses, class)
|
||||
klog.V(5).Infof("get defaultClass added: %s, driver: %s", class.Name, pvDriver)
|
||||
}
|
||||
|
Reference in New Issue
Block a user