Skip to content

Commit 79eba72

Browse files
committed
remove unused labels from util
Removed the unused labels and test code
1 parent 55def14 commit 79eba72

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

pkg/common-controller/framework_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,16 +1346,6 @@ func newGroupSnapshotContentArray(groupSnapshotContentName, boundToGroupSnapshot
13461346
}
13471347
}
13481348

1349-
func withSnapshotContentInvalidLabel(contents []*crdv1.VolumeSnapshotContent) []*crdv1.VolumeSnapshotContent {
1350-
for i := range contents {
1351-
if contents[i].ObjectMeta.Labels == nil {
1352-
contents[i].ObjectMeta.Labels = make(map[string]string)
1353-
}
1354-
contents[i].ObjectMeta.Labels[utils.VolumeSnapshotContentInvalidLabel] = ""
1355-
}
1356-
return contents
1357-
}
1358-
13591349
func withContentAnnotations(contents []*crdv1.VolumeSnapshotContent, annotations map[string]string) []*crdv1.VolumeSnapshotContent {
13601350
for i := range contents {
13611351
if contents[i].ObjectMeta.Annotations == nil {
@@ -1559,16 +1549,6 @@ func newSnapshotArray(
15591549
}
15601550
}
15611551

1562-
func withSnapshotInvalidLabel(snapshots []*crdv1.VolumeSnapshot) []*crdv1.VolumeSnapshot {
1563-
for i := range snapshots {
1564-
if snapshots[i].ObjectMeta.Labels == nil {
1565-
snapshots[i].ObjectMeta.Labels = make(map[string]string)
1566-
}
1567-
snapshots[i].ObjectMeta.Labels[utils.VolumeSnapshotInvalidLabel] = ""
1568-
}
1569-
return snapshots
1570-
}
1571-
15721552
func newSnapshotClass(snapshotClassName, snapshotClassUID, driverName string, isDefaultClass bool) *crdv1.VolumeSnapshotClass {
15731553
sc := &crdv1.VolumeSnapshotClass{
15741554
ObjectMeta: metav1.ObjectMeta{

pkg/utils/util.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ const (
157157
// to create snapshot if the snapshot belongs to a group.
158158
VolumeGroupSnapshotHandleAnnotation = "groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle"
159159

160-
// VolumeSnapshotContentInvalidLabel is applied to invalid content as a label key. The value does not matter.
161-
// See https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md#automatic-labelling-of-invalid-objects
162-
VolumeSnapshotContentInvalidLabel = "snapshot.storage.kubernetes.io/invalid-snapshot-content-resource"
163-
// VolumeSnapshotInvalidLabel is applied to invalid snapshot as a label key. The value does not matter.
164-
// See https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md#automatic-labelling-of-invalid-objects
165-
VolumeSnapshotInvalidLabel = "snapshot.storage.kubernetes.io/invalid-snapshot-resource"
166160
// VolumeSnapshotContentManagedByLabel is applied by the snapshot controller to the VolumeSnapshotContent object in case distributed snapshotting is enabled.
167161
// The value contains the name of the node that handles the snapshot for the volume local to that node.
168162
VolumeSnapshotContentManagedByLabel = "snapshot.storage.kubernetes.io/managed-by"

0 commit comments

Comments
 (0)