From 3428a61e77018cfdafe82c308509c2584ea148a7 Mon Sep 17 00:00:00 2001 From: Mohammad Asif Siddiqui Date: Fri, 25 Nov 2022 17:51:15 +0530 Subject: [PATCH] Fix misspell and gomft -s (#161) * Fix misspell and gomft -s * Ignore gocycle --- controllers/vdoconfig_controller.go | 4 ++++ pkg/drivers/csi/csiutil_test.go | 2 +- pkg/session/session_test.go | 2 +- vdoctl/cmd/drivers.go | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/controllers/vdoconfig_controller.go b/controllers/vdoconfig_controller.go index 7a81b44..e08be0b 100644 --- a/controllers/vdoconfig_controller.go +++ b/controllers/vdoconfig_controller.go @@ -132,6 +132,7 @@ var ( // +kubebuilder:rbac:groups="",resources=configmaps,verbs=create;get;list;watch;update;patch;delete; // +kubebuilder:rbac:groups=*,resources=namespaces,verbs=create;get;list;watch;update;patch;delete; +//gocyclo:ignore func (r *VDOConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger.Info("Inside VDOConfig reconciler", "name", req.NamespacedName) @@ -355,6 +356,7 @@ func (r *VDOConfigReconciler) getVcSession(vdoctx vdocontext.VDOContext, config return sess, nil } +//gocyclo:ignore func (r *VDOConfigReconciler) reconcileCPIConfiguration(vdoctx vdocontext.VDOContext, req ctrl.Request, vdoConfig *vdov1alpha1.VDOConfig, clientset *kubernetes.Clientset) (ctrl.Result, error) { vsphereCloudConfigsList := vdoConfig.Spec.CloudProvider.VsphereCloudConfigs @@ -450,6 +452,7 @@ func (r *VDOConfigReconciler) reconcileCPIConfiguration(vdoctx vdocontext.VDOCon return ctrl.Result{}, nil } +//gocyclo:ignore func (r *VDOConfigReconciler) reconcileCSIConfiguration(vdoctx vdocontext.VDOContext, req ctrl.Request, vdoConfig *vdov1alpha1.VDOConfig, clientset *kubernetes.Clientset) (ctrl.Result, error) { vsphereCloudConfig, err := r.fetchVSphereCloudConfig(vdoctx, vdoConfig.Spec.StorageProvider.VsphereCloudConfig, req.Namespace) @@ -1414,6 +1417,7 @@ func (r *VDOConfigReconciler) getMatrixConfig(matrixConfigUrl, matrixConfigConte } } +//gocyclo:ignore func (r *VDOConfigReconciler) updateCSIDaemonSet(ctx vdocontext.VDOContext, kubPath string) error { ds := &appsv1.DaemonSet{} kubeletDefaultPath := "/var/lib/kubelet" diff --git a/pkg/drivers/csi/csiutil_test.go b/pkg/drivers/csi/csiutil_test.go index 836fc3d..7de8a19 100644 --- a/pkg/drivers/csi/csiutil_test.go +++ b/pkg/drivers/csi/csiutil_test.go @@ -69,7 +69,7 @@ var _ = Describe("TestSecretCreation", func() { FileVolumes: v1alpha1.FileVolume{ VSanDataStoreUrl: []string{"ds:///vmfs/volumes/vsan:123/"}, NetPermissions: []v1alpha1.NetPermission{ - v1alpha1.NetPermission{ + { Ip: "10.10.10.0/24", Permission: "READ_WRITE", RootSquash: true, diff --git a/pkg/session/session_test.go b/pkg/session/session_test.go index 6a38f63..641fa87 100644 --- a/pkg/session/session_test.go +++ b/pkg/session/session_test.go @@ -104,7 +104,7 @@ var _ = Describe("vc session functions", func() { networkSpec := types.CustomizationSpec{ NicSettingMap: []types.CustomizationAdapterMapping{ - types.CustomizationAdapterMapping{ + { Adapter: types.CustomizationIPSettings{ Ip: &types.CustomizationFixedIp{ IpAddress: "192.168.1.100", diff --git a/vdoctl/cmd/drivers.go b/vdoctl/cmd/drivers.go index f754dac..eae8a3d 100644 --- a/vdoctl/cmd/drivers.go +++ b/vdoctl/cmd/drivers.go @@ -91,7 +91,7 @@ var driversCmd = &cobra.Command{ configFlag := cm.Data["configured-by"] if !strings.EqualFold(configFlag, UserConfig) { - isConfigRequired := utils.PromptGetInput("VDO is configured with default compatiblity matrix. you can update compatiblity-matrix using 'vdoctl update compatiblity-matrix'. Do you want to use the defaults for compatiblity matrix (Y/N) ? ", errors.New("invalid input"), utils.IsString) + isConfigRequired := utils.PromptGetInput("VDO is configured with default compatibility matrix. you can update compatibility-matrix using 'vdoctl update compatibility-matrix'. Do you want to use the defaults for compatibility matrix (Y/N) ? ", errors.New("invalid input"), utils.IsString) if !strings.EqualFold(isConfigRequired, "Y") { os.Exit(0) }