Merge pull request #669 from pwschuurman/bugfix-666-status-check

Check if Status on Snapshot before checking if Status.Error is present
This commit is contained in:
Kubernetes Prow Robot
2022-03-09 07:40:13 -08:00
committed by GitHub

View File

@@ -104,7 +104,7 @@ func NewCSISnapshotSideCarController(
// and CSI CreateSnapshot will be called again without exponential backoff.
// So we are skipping the re-queue here to avoid CreateSnapshot being called without exponential backoff.
newSnapContent := newObj.(*crdv1.VolumeSnapshotContent)
if newSnapContent.Status.Error != nil {
if newSnapContent.Status != nil && newSnapContent.Status.Error != nil {
oldSnapContent := oldObj.(*crdv1.VolumeSnapshotContent)
_, newExists := newSnapContent.ObjectMeta.Annotations[utils.AnnVolumeSnapshotBeingCreated]
_, oldExists := oldSnapContent.ObjectMeta.Annotations[utils.AnnVolumeSnapshotBeingCreated]