Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/e2e/e2e_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,14 @@ const (
envStoragePolicyNameForVsanNfsDatastores = "STORAGE_POLICY_FOR_VSAN_NFS_DATASTORES"
devopsKubeConf = "DEV_OPS_USER_KUBECONFIG"
quotaSupportedVCVersion = "9.0.0"
lateBinding = "-latebinding"
cnsVolumeDeleteTimeout = 5 * time.Minute
vscDeleteTimeout = 5 * time.Minute

lateBinding = "-latebinding"
cnsVolumeDeleteTimeout = 5 * time.Minute
vscDeleteTimeout = 5 * time.Minute

selectedNodeIsZone = "cns.vmware.com/selected-node-is-zone"
selectedNodeAnnotationOnPVC = "volume.kubernetes.io/selected-node"
vmZoneLabel = "topology.kubernetes.io/zone"
)

/*
Expand Down
16 changes: 16 additions & 0 deletions tests/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8373,3 +8373,19 @@ func getSvcConfigSecretData(client clientset.Interface, ctx context.Context,

return vsphereCfg, nil
}

// validate Annotation on PVC
func validateAnnotationOnPVC(pvc *v1.PersistentVolumeClaim, annotationKey string, expectedValue string) error {
val, exists := pvc.Annotations[annotationKey]
if !exists {
framework.Logf("PVC %s does NOT have annotation %q\n", pvc.Name, annotationKey)
return fmt.Errorf("PVC %s does NOT have annotation %q\n", pvc.Name, annotationKey)
}
if val == expectedValue {
framework.Logf("PVC %s has annotation %q with correct value: %s\n", pvc.Name, annotationKey, val)
} else {
return fmt.Errorf("PVC %s has annotation %q but value is %q (expected %q)\n",
pvc.Name, annotationKey, val, expectedValue)
}
return nil
}
Loading