Skip to content

Commit 4017329

Browse files
committed
Improve error messages
1 parent 3b76de4 commit 4017329

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
260260
if content.Spec.VolumeSnapshotClassName != nil {
261261
class, err := ctrl.getSnapshotClass(*content.Spec.VolumeSnapshotClassName)
262262
if err != nil {
263-
klog.Errorf("failed to getSnapshotClass %s", err)
264-
return nil, fmt.Errorf("cannot get snapshot class for snapshot content %s", err)
263+
klog.Errorf("Failed to getSnapshotClass %s", err)
264+
return nil, fmt.Errorf("cannot get snapshot class %s for snapshot content %s", *content.Spec.VolumeSnapshotClassName, err)
265265
}
266266

267267
snapshotterListSecretRef, err := utils.GetSecretReference(utils.SnapshotterListSecretParams, class.Parameters, content.GetObjectMeta().GetName(), nil)
@@ -273,7 +273,7 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
273273
snapshotterListCredentials, err = utils.GetCredentials(ctrl.client, snapshotterListSecretRef)
274274
if err != nil {
275275
// Continue with deletion, as the secret may have already been deleted.
276-
klog.Errorf("Failed to credentials for snapshot %s: %s", content.Name, err.Error())
276+
klog.Errorf("Failed to get credentials for snapshot %s: %s", content.Name, err.Error())
277277
return nil, fmt.Errorf("cannot get credentials for snapshot content %#v", content.Name)
278278
}
279279
}

0 commit comments

Comments
 (0)