diff --git a/examples/README.md b/examples/README.md index c159dcddb..c17abf6b3 100644 --- a/examples/README.md +++ b/examples/README.md @@ -73,7 +73,7 @@ In the `examples/rbd` directory you will find two files related to snapshots: [snapshot.yaml](./rbd/snapshot.yaml). Once you created your RBD volume, you'll need to customize at least -`snapshotclass.yaml` and make sure the `clusterid` and `pool` parameters match +`snapshotclass.yaml` and make sure the `clusterid` parameter matches your Ceph cluster setup. If you followed the documentation to create the rbdplugin, you shouldn't have to edit any other file. diff --git a/examples/rbd/snapshotclass.yaml b/examples/rbd/snapshotclass.yaml index ba68c31c7..1955cd4e1 100644 --- a/examples/rbd/snapshotclass.yaml +++ b/examples/rbd/snapshotclass.yaml @@ -14,7 +14,5 @@ parameters: # represent the Ceph cluster in clusterID below clusterID: - pool: rbd - csi.storage.k8s.io/snapshotter-secret-name: csi-rbd-secret csi.storage.k8s.io/snapshotter-secret-namespace: default diff --git a/pkg/rbd/rbd_util.go b/pkg/rbd/rbd_util.go index 780250e3a..6570829c7 100644 --- a/pkg/rbd/rbd_util.go +++ b/pkg/rbd/rbd_util.go @@ -477,16 +477,10 @@ func getCredsFromVol(rbdVol *rbdVolume, volOptions map[string]string) { } func genSnapFromOptions(rbdVol *rbdVolume, snapOptions map[string]string) *rbdSnapshot { - var ( - err error - ok bool - ) + var err error rbdSnap := &rbdSnapshot{} - rbdSnap.Pool, ok = snapOptions["pool"] - if !ok { - rbdSnap.Pool = rbdVol.Pool - } + rbdSnap.Pool = rbdVol.Pool rbdSnap.Monitors, rbdSnap.ClusterID, err = getMonsAndClusterID(snapOptions) if err != nil {