e2e: validate clusterName metadata

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-07-28 16:18:00 +05:30 committed by mergify[bot]
parent de7128b3a2
commit cf97e377fa
2 changed files with 8 additions and 0 deletions

View File

@ -970,7 +970,10 @@ var _ = Describe(cephfsType, func() {
} else if metadata.VolSnapContentNameKey != content.Name {
e2elog.Failf("failed, contentname expected:%s got:%s",
content.Name, metadata.VolSnapContentNameKey)
} else if metadata.ClusterNameKey != defaultClusterName {
e2elog.Failf("expected clusterName %q got %q", defaultClusterName, metadata.ClusterNameKey)
}
// Delete the parent pvc before restoring
// another one from snapshot.
err = deletePVCAndValidatePV(f.ClientSet, pvc, deployTimeout)
@ -1005,6 +1008,8 @@ var _ = Describe(cephfsType, func() {
e2elog.Failf("expected pvcNamespace %q got %q", pvcClone.Namespace, cloneMetadata.PVCNamespaceKey)
} else if cloneMetadata.PVNameKey != pvcCloneObj.Spec.VolumeName {
e2elog.Failf("expected pvName %q got %q", pvcCloneObj.Spec.VolumeName, cloneMetadata.PVNameKey)
} else if cloneMetadata.ClusterNameKey != defaultClusterName {
e2elog.Failf("expected clusterName %q got %q", defaultClusterName, cloneMetadata.ClusterNameKey)
}
// delete clone
@ -1067,6 +1072,8 @@ var _ = Describe(cephfsType, func() {
e2elog.Failf("expected pvcNamespace %q got %q", pvc.Namespace, cloneMetadata.PVCNamespaceKey)
} else if cloneMetadata.PVNameKey != pvcCloneObj.Spec.VolumeName {
e2elog.Failf("expected pvName %q got %q", pvcCloneObj.Spec.VolumeName, cloneMetadata.PVNameKey)
} else if cloneMetadata.ClusterNameKey != defaultClusterName {
e2elog.Failf("expected clusterName %q got %q", defaultClusterName, cloneMetadata.ClusterNameKey)
}
err = deletePVCAndValidatePV(f.ClientSet, pvcClone, deployTimeout)

View File

@ -249,6 +249,7 @@ type cephfsSnapshotMetadata struct {
VolSnapNameKey string `json:"csi.storage.k8s.io/volumesnapshot/name"`
VolSnapNamespaceKey string `json:"csi.storage.k8s.io/volumesnapshot/namespace"`
VolSnapContentNameKey string `json:"csi.storage.k8s.io/volumesnapshotcontent/name"`
ClusterNameKey string `json:"csi.ceph.com/cluster/name"`
}
func listCephFSSnapshotMetadata(