From 6a4dfa47e5aee313dc120a0e952a16798d903d06 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Sun, 6 Jan 2019 14:53:24 +0530 Subject: [PATCH] Fix error formatting in snapshot controller. Signed-off-by: Humble Chirammal --- pkg/controller/snapshot_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/snapshot_controller.go b/pkg/controller/snapshot_controller.go index d462a555..18342095 100644 --- a/pkg/controller/snapshot_controller.go +++ b/pkg/controller/snapshot_controller.go @@ -864,7 +864,7 @@ func (ctrl *csiSnapshotController) getStorageClassFromVolumeSnapshot(snapshot *c storageclassName = volume.Spec.StorageClassName } if len(storageclassName) == 0 { - return nil, fmt.Errorf("cannot figure out the snapshot class automatically, please specify one in snapshot spec.") + return nil, fmt.Errorf("cannot figure out the snapshot class automatically, please specify one in snapshot spec") } storageclass, err := ctrl.client.StorageV1().StorageClasses().Get(*pvc.Spec.StorageClassName, metav1.GetOptions{}) if err != nil { @@ -934,7 +934,7 @@ func (ctrl *csiSnapshotController) SetDefaultSnapshotClass(snapshot *crdv1.Volum // getClaimFromVolumeSnapshot is a helper function to get PVC from VolumeSnapshot. func (ctrl *csiSnapshotController) getClaimFromVolumeSnapshot(snapshot *crdv1.VolumeSnapshot) (*v1.PersistentVolumeClaim, error) { if snapshot.Spec.Source == nil { - return nil, fmt.Errorf("the snapshot source is not specified.") + return nil, fmt.Errorf("the snapshot source is not specified") } if snapshot.Spec.Source.Kind != pvcKind { return nil, fmt.Errorf("the snapshot source is not the right type. Expected %s, Got %v", pvcKind, snapshot.Spec.Source.Kind)