diff --git a/pkg/controller/data_upload_controller_test.go b/pkg/controller/data_upload_controller_test.go index 36f4684f63..6272608e77 100644 --- a/pkg/controller/data_upload_controller_test.go +++ b/pkg/controller/data_upload_controller_test.go @@ -226,8 +226,8 @@ func initDataUploaderReconcilerWithError(needError ...error) (*DataUploadReconci } } - fakeSnapshotClient := snapshotFake.NewSimpleClientset(vsObject, vscObj, storageClassObject) - fakeKubeClient := clientgofake.NewSimpleClientset(daemonSet) + fakeSnapshotClient := snapshotFake.NewSimpleClientset(vsObject, vscObj) + fakeKubeClient := clientgofake.NewSimpleClientset(daemonSet, storageClassObject) fakeFS := velerotest.NewFakeFileSystem() pathGlob := fmt.Sprintf("/host_pods/%s/volumes/*/%s", "", dataUploadName) _, err = fakeFS.Create(pathGlob) diff --git a/pkg/exposer/csi_snapshot.go b/pkg/exposer/csi_snapshot.go index e698417426..5c814c7c31 100644 --- a/pkg/exposer/csi_snapshot.go +++ b/pkg/exposer/csi_snapshot.go @@ -386,13 +386,13 @@ func (e *csiSnapshotExposer) createBackupPVC(ctx context.Context, ownerObject co } // transform the PVC if the storage class provisioner supports shallow copy restore to avoid copy on restore for some storage provisioners - updated_pvc, err := shallowprovisioner.ShallowCopyTransform(ctx, e.kubeClient.StorageV1(), pvc) + updatedPVC, err := shallowprovisioner.ShallowCopyTransform(ctx, e.kubeClient.StorageV1(), pvc) if err != nil { // failed to retrieve the storageClass of the PVC return nil, err } - created, err := e.kubeClient.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(ctx, updated_pvc, metav1.CreateOptions{}) + created, err := e.kubeClient.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(ctx, updatedPVC, metav1.CreateOptions{}) if err != nil { return nil, errors.Wrap(err, "error to create pvc") } diff --git a/pkg/exposer/shallowprovisioner/shallow_provisioner.go b/pkg/exposer/shallowprovisioner/shallow_provisioner.go index 0b1f6f7dcd..c0a3cd10e9 100644 --- a/pkg/exposer/shallowprovisioner/shallow_provisioner.go +++ b/pkg/exposer/shallowprovisioner/shallow_provisioner.go @@ -127,11 +127,11 @@ func (p cephFSProvisioner) Evaluate(storageClass *storagev1api.StorageClass) boo // cephfs only requires that the accessmode is set to readwriteonly func (p cephFSProvisioner) Transform(pvc *corev1api.PersistentVolumeClaim) *corev1api.PersistentVolumeClaim { - transform_pvc := pvc.DeepCopy() + transformPVC := pvc.DeepCopy() - transform_pvc.Spec.AccessModes = []corev1api.PersistentVolumeAccessMode{corev1api.ReadOnlyMany} + transformPVC.Spec.AccessModes = []corev1api.PersistentVolumeAccessMode{corev1api.ReadOnlyMany} - return transform_pvc + return transformPVC } /* @@ -158,9 +158,9 @@ func (p scaleProvisioner) Evaluate(storageClass *storagev1api.StorageClass) bool // scale only requires that the accessmode is set to readwriteonly func (p scaleProvisioner) Transform(pvc *corev1api.PersistentVolumeClaim) *corev1api.PersistentVolumeClaim { - transform_pvc := pvc.DeepCopy() + transformPVC := pvc.DeepCopy() - transform_pvc.Spec.AccessModes = []corev1api.PersistentVolumeAccessMode{corev1api.ReadOnlyMany} + transformPVC.Spec.AccessModes = []corev1api.PersistentVolumeAccessMode{corev1api.ReadOnlyMany} - return transform_pvc + return transformPVC }