Skip to content

Commit

Permalink
Merge pull request #1222 from Madhu-1/fix-1206
Browse files Browse the repository at this point in the history
remove unused labels from util
  • Loading branch information
k8s-ci-robot authored Nov 25, 2024
2 parents fe82dd2 + 79eba72 commit b79aef9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
20 changes: 0 additions & 20 deletions pkg/common-controller/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down
6 changes: 0 additions & 6 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b79aef9

Please sign in to comment.