Skip to content

Commit 03f3b9b

Browse files
authored
Merge pull request #669 from pwschuurman/bugfix-666-status-check
Check if Status on Snapshot before checking if Status.Error is present
2 parents 8e5ae41 + 497a316 commit 03f3b9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sidecar-controller/snapshot_controller_base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func NewCSISnapshotSideCarController(
104104
// and CSI CreateSnapshot will be called again without exponential backoff.
105105
// So we are skipping the re-queue here to avoid CreateSnapshot being called without exponential backoff.
106106
newSnapContent := newObj.(*crdv1.VolumeSnapshotContent)
107-
if newSnapContent.Status.Error != nil {
107+
if newSnapContent.Status != nil && newSnapContent.Status.Error != nil {
108108
oldSnapContent := oldObj.(*crdv1.VolumeSnapshotContent)
109109
_, newExists := newSnapContent.ObjectMeta.Annotations[utils.AnnVolumeSnapshotBeingCreated]
110110
_, oldExists := oldSnapContent.ObjectMeta.Annotations[utils.AnnVolumeSnapshotBeingCreated]

0 commit comments

Comments
 (0)