diff --git a/pkg/common-controller/framework_test.go b/pkg/common-controller/framework_test.go index 63f337c0a..db602399d 100644 --- a/pkg/common-controller/framework_test.go +++ b/pkg/common-controller/framework_test.go @@ -1346,16 +1346,6 @@ func newGroupSnapshotContentArray(groupSnapshotContentName, boundToGroupSnapshot } } -func withSnapshotContentInvalidLabel(contents []*crdv1.VolumeSnapshotContent) []*crdv1.VolumeSnapshotContent { - for i := range contents { - if contents[i].ObjectMeta.Labels == nil { - contents[i].ObjectMeta.Labels = make(map[string]string) - } - contents[i].ObjectMeta.Labels[utils.VolumeSnapshotContentInvalidLabel] = "" - } - return contents -} - func withContentAnnotations(contents []*crdv1.VolumeSnapshotContent, annotations map[string]string) []*crdv1.VolumeSnapshotContent { for i := range contents { if contents[i].ObjectMeta.Annotations == nil { @@ -1559,16 +1549,6 @@ func newSnapshotArray( } } -func withSnapshotInvalidLabel(snapshots []*crdv1.VolumeSnapshot) []*crdv1.VolumeSnapshot { - for i := range snapshots { - if snapshots[i].ObjectMeta.Labels == nil { - snapshots[i].ObjectMeta.Labels = make(map[string]string) - } - snapshots[i].ObjectMeta.Labels[utils.VolumeSnapshotInvalidLabel] = "" - } - return snapshots -} - func newSnapshotClass(snapshotClassName, snapshotClassUID, driverName string, isDefaultClass bool) *crdv1.VolumeSnapshotClass { sc := &crdv1.VolumeSnapshotClass{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/utils/util.go b/pkg/utils/util.go index a229bbae9..8f70d3d5d 100644 --- a/pkg/utils/util.go +++ b/pkg/utils/util.go @@ -157,12 +157,6 @@ const ( // to create snapshot if the snapshot belongs to a group. VolumeGroupSnapshotHandleAnnotation = "groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle" - // VolumeSnapshotContentInvalidLabel is applied to invalid content as a label key. The value does not matter. - // See https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md#automatic-labelling-of-invalid-objects - VolumeSnapshotContentInvalidLabel = "snapshot.storage.kubernetes.io/invalid-snapshot-content-resource" - // VolumeSnapshotInvalidLabel is applied to invalid snapshot as a label key. The value does not matter. - // See https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md#automatic-labelling-of-invalid-objects - VolumeSnapshotInvalidLabel = "snapshot.storage.kubernetes.io/invalid-snapshot-resource" // VolumeSnapshotContentManagedByLabel is applied by the snapshot controller to the VolumeSnapshotContent object in case distributed snapshotting is enabled. // The value contains the name of the node that handles the snapshot for the volume local to that node. VolumeSnapshotContentManagedByLabel = "snapshot.storage.kubernetes.io/managed-by"