Add Happy Path VolumeAttributesClass CSI E2E Tests
Signed-off-by: Connor Catlett <conncatl@amazon.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apiserver/pkg/storage/names"
|
||||
"k8s.io/kubernetes/pkg/volume/util"
|
||||
@@ -92,3 +93,13 @@ func GetStorageClass(
|
||||
VolumeBindingMode: bindingMode,
|
||||
}
|
||||
}
|
||||
|
||||
// CopyVolumeAttributesClass constructs a new VolumeAttributesClass instance
|
||||
// with a unique name that is based on namespace + suffix
|
||||
// using the VolumeAttributesClass passed in as a parameter
|
||||
func CopyVolumeAttributesClass(vac *storagev1alpha1.VolumeAttributesClass, ns string, suffix string) *storagev1alpha1.VolumeAttributesClass {
|
||||
copy := vac.DeepCopy()
|
||||
copy.ObjectMeta.Name = names.SimpleNameGenerator.GenerateName(ns + "-" + suffix)
|
||||
copy.ResourceVersion = ""
|
||||
return copy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user