Skip to content

Commit

Permalink
add groupversion field in the args
Browse files Browse the repository at this point in the history
  • Loading branch information
kale-amruta committed Aug 30, 2023
1 parent 0af2e9d commit 9a03a5d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kube/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ type CreatePVCFromSnapshotArgs struct {
Annotations map[string]string
VolumeMode *v1.PersistentVolumeMode
AccessModes []v1.PersistentVolumeAccessMode
APIGroupVersion *metav1.GroupVersion
}

// CreatePVCFromSnapshot will restore a volume and returns the resulting
Expand All @@ -131,6 +132,10 @@ func CreatePVCFromSnapshot(ctx context.Context, args *CreatePVCFromSnapshotArgs)
}
snapshotKind := "VolumeSnapshot"
snapshotAPIGroup := "snapshot.storage.k8s.io"
if args.APIGroupVersion != nil {
snapshotAPIGroup = args.APIGroupVersion.String()
}

pvc := &v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{
Labels: args.Labels,
Expand Down

0 comments on commit 9a03a5d

Please sign in to comment.