Skip to content

Commit

Permalink
manifest: adding a null check to PersistentVolumeClaim conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
  • Loading branch information
rkachach committed Feb 20, 2024
1 parent bd7477e commit 952ec5a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/apis/ceph.rook.io/v1/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ func (src *ConfigFileVolumeSource) ToKubernetesVolumeSource() *corev1.VolumeSour
}

func (t *VolumeClaimTemplate) ToPVC() *corev1.PersistentVolumeClaim {
ret := &corev1.PersistentVolumeClaim{
ObjectMeta: *t.ObjectMeta.DeepCopy(),
Spec: *t.Spec.DeepCopy(),
if t != nil {
return &corev1.PersistentVolumeClaim{
ObjectMeta: *t.ObjectMeta.DeepCopy(),
Spec: *t.Spec.DeepCopy(),
}
}
return ret
return nil
}

0 comments on commit 952ec5a

Please sign in to comment.