mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Remove default annotations from copied storage class
This commit is contained in:
parent
4516c7972d
commit
73883c7157
@ -22,6 +22,7 @@ import (
|
|||||||
storagev1 "k8s.io/api/storage/v1"
|
storagev1 "k8s.io/api/storage/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apiserver/pkg/storage/names"
|
"k8s.io/apiserver/pkg/storage/names"
|
||||||
|
"k8s.io/kubernetes/pkg/volume/util"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -57,6 +58,11 @@ func CopyStorageClass(sc *storagev1.StorageClass, ns string, suffix string) *sto
|
|||||||
copy := sc.DeepCopy()
|
copy := sc.DeepCopy()
|
||||||
copy.ObjectMeta.Name = names.SimpleNameGenerator.GenerateName(ns + "-" + suffix)
|
copy.ObjectMeta.Name = names.SimpleNameGenerator.GenerateName(ns + "-" + suffix)
|
||||||
copy.ResourceVersion = ""
|
copy.ResourceVersion = ""
|
||||||
|
|
||||||
|
// Remove the default annotation from the storage class if they exists.
|
||||||
|
// Multiple storage classes with this annotation will result in failure.
|
||||||
|
delete(copy.Annotations, util.BetaIsDefaultStorageClassAnnotation)
|
||||||
|
delete(copy.Annotations, util.IsDefaultStorageClassAnnotation)
|
||||||
return copy
|
return copy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user