Skip to content

Commit

Permalink
Merge pull request #399 from red-hat-storage/sync_us--devel
Browse files Browse the repository at this point in the history
Syncing latest changes from upstream devel for ceph-csi
  • Loading branch information
openshift-merge-bot[bot] authored Oct 15, 2024
2 parents 2893220 + 395b062 commit fed84fc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
13 changes: 13 additions & 0 deletions examples/rbd/groupsnapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshot
metadata:
name: rbd-groupsnapshot
spec:
source:
selector:
matchLabels:
# The PVCs will need to have this label for it to be
# included in the VolumeGroupSnapshot
group: test
volumeGroupSnapshotClassName: csi-rbdplugin-groupsnapclass
19 changes: 19 additions & 0 deletions examples/rbd/groupsnapshotclass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotClass
metadata:
name: csi-rbdplugin-groupsnapclass
driver: rbd.csi.ceph.com
parameters:
# String representing a Ceph cluster to provision storage from.
# Should be unique across all Ceph clusters in use for provisioning,
# cannot be greater than 36 bytes in length, and should remain immutable for
# the lifetime of the StorageClass in use
clusterID: <cluster-id>

# eg: pool: rbdpool
pool: <rbd-pool-name>

csi.storage.k8s.io/group-snapshotter-secret-name: csi-rbd-secret
csi.storage.k8s.io/group-snapshotter-secret-namespace: default
deletionPolicy: Delete
2 changes: 2 additions & 0 deletions examples/rbd/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rbd-pvc
labels:
group: test
spec:
accessModes:
- ReadWriteOnce
Expand Down
5 changes: 4 additions & 1 deletion internal/journal/volumegroupjournal.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ func (vgc *VolumeGroupJournalConfig) Connect(

// Destroy frees any resources and invalidates the journal connection.
func (vgjc *volumeGroupJournalConnection) Destroy() {
vgjc.connection.Destroy()
if vgjc.connection != nil {
vgjc.connection.Destroy()
vgjc.connection = nil
}
}

// VolumeGroupData contains the GroupUUID and VolumeGroupAttributes for a
Expand Down
4 changes: 2 additions & 2 deletions internal/rbd/group/volume_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (vg *volumeGroup) Delete(ctx context.Context) error {
}

err = librbd.GroupRemove(ioctx, name)
if err != nil && !errors.Is(rados.ErrNotFound, err) {
if err != nil && !errors.Is(err, rados.ErrNotFound) {
return fmt.Errorf("failed to remove volume group %q: %w", vg, err)
}

Expand Down Expand Up @@ -245,7 +245,7 @@ func (vg *volumeGroup) RemoveVolume(ctx context.Context, vol types.Volume) error

err := vol.RemoveFromGroup(ctx, vg)
if err != nil {
if errors.Is(librbd.ErrNotExist, err) {
if errors.Is(err, librbd.ErrNotExist) {
return nil
}

Expand Down

0 comments on commit fed84fc

Please sign in to comment.