Skip to content

Commit 40b318a

Browse files
authored
WFFC vmservice vm (#3635)
1 parent 30f1f87 commit 40b318a

File tree

4 files changed

+867
-88
lines changed

4 files changed

+867
-88
lines changed

tests/e2e/e2e_common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ const (
278278
lateBinding = "-latebinding"
279279
cnsVolumeDeleteTimeout = 5 * time.Minute
280280
vscDeleteTimeout = 5 * time.Minute
281+
selectedNodeIsZone = "cns.vmware.com/selected-node-is-zone"
282+
selectedNodeAnnotationOnPVC = "volume.kubernetes.io/selected-node"
283+
vmZoneLabel = "topology.kubernetes.io/zone"
281284
)
282285

283286
/*

tests/e2e/util.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8375,3 +8375,18 @@ func getSvcConfigSecretData(client clientset.Interface, ctx context.Context,
83758375

83768376
return vsphereCfg, nil
83778377
}
8378+
8379+
// validate Annotation on PVC
8380+
func validateAnnotationOnPVC(pvc *v1.PersistentVolumeClaim, annotationKey string, expectedValue string) error {
8381+
val, exists := pvc.Annotations[annotationKey]
8382+
if !exists {
8383+
return fmt.Errorf("PVC %s does NOT have annotation %q", pvc.Name, annotationKey)
8384+
}
8385+
if val == expectedValue {
8386+
framework.Logf("PVC %s has annotation %q with correct value: %s", pvc.Name, annotationKey, val)
8387+
} else {
8388+
return fmt.Errorf("PVC %s has annotation %q but value is %q (expected %q)", pvc.Name,
8389+
annotationKey, val, expectedValue)
8390+
}
8391+
return nil
8392+
}

0 commit comments

Comments
 (0)