Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
csi: install vgs CRD in tests
Browse files Browse the repository at this point in the history
update the snapshot controller to 7.0.1
and install new Volumegroup CRD's

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
  • Loading branch information
Madhu-1 committed Mar 1, 2024
1 parent 77bfcd4 commit 0d5bd70
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions tests/framework/utils/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,18 @@ import (
const (
// snapshotterVersion from which the snapshotcontroller and CRD will be
// installed
snapshotterVersion = "v5.0.1"
snapshotterVersion = "v7.0.1"
repoURL = "https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter"
rbacPath = "deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml"
controllerPath = "deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml"
// snapshot CRD path
// snapshot CRD path
snapshotClassCRDPath = "client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml"
volumeSnapshotContentsCRDPath = "client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml"
volumeSnapshotCRDPath = "client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml"
// volumegroupsnapshot CRD path
volumeGroupSnapshotClassCRDPath = "client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotclasses.yaml"
volumeGroupSnapshotContentsCRDPath = "client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml"
volumeGroupSnapshotCRDPath = "client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshots.yaml"
)

// CheckSnapshotISReadyToUse checks snapshot is ready to use
Expand Down Expand Up @@ -143,6 +147,24 @@ func (k8sh *K8sHelper) snapshotCRD(action string) error {
if err != nil {
return err
}
vgsClassCRD := fmt.Sprintf("%s/%s/%s", repoURL, snapshotterVersion, volumeGroupSnapshotClassCRDPath)
_, err = k8sh.Kubectl(args(vgsClassCRD)...)
if err != nil {
return err
}

vgsContentsCRD := fmt.Sprintf("%s/%s/%s", repoURL, snapshotterVersion, volumeGroupSnapshotContentsCRDPath)
_, err = k8sh.Kubectl(args(vgsContentsCRD)...)
if err != nil {
return err
}

vgsCRD := fmt.Sprintf("%s/%s/%s", repoURL, snapshotterVersion, volumeGroupSnapshotCRDPath)
_, err = k8sh.Kubectl(args(vgsCRD)...)
if err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 0d5bd70

Please sign in to comment.