Skip to content

Commit

Permalink
Remove nolint usages for errcheck, revive, prealloc, goconst, ineffas…
Browse files Browse the repository at this point in the history
…sign
  • Loading branch information
Ankitasw committed Sep 29, 2023
1 parent e77d02c commit 0269742
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion controllers/vmware/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (r *ClusterReconciler) reconcileAPIEndpoints(ctx context.Context, clusterCt

// Define a variable to assign the API endpoints of control plane
// machines as they are discovered.
var apiEndpointList []clusterv1.APIEndpoint //nolint:prealloc
apiEndpointList := []clusterv1.APIEndpoint{}

// Iterate over the cluster's control plane CAPI machines.
for _, machine := range machines {
Expand Down
3 changes: 1 addition & 2 deletions pkg/identity/identity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"sigs.k8s.io/cluster-api-provider-vsphere/pkg/manager"
)

//nolint:goconst
var _ = Describe("GetCredentials", func() {
var (
ns *corev1.Namespace
Expand Down Expand Up @@ -116,7 +115,7 @@ var _ = Describe("GetCredentials", func() {
if labels == nil {
labels = map[string]string{}
}
labels["identity-authorized"] = "true"
labels["identity-authorized"] = "true" //nolint: goconst
ns.Labels = labels
Expect(k8sclient.Update(ctx, ns)).To(Succeed())

Expand Down
11 changes: 5 additions & 6 deletions pkg/services/network/dummy_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//nolint:revive
package network

import (
Expand All @@ -39,23 +38,23 @@ func (np *dummyNetworkProvider) HasLoadBalancer() bool {
return false
}

func (np *dummyNetworkProvider) ProvisionClusterNetwork(ctx context.Context, clusterCtx *vmware.ClusterContext) error {
func (np *dummyNetworkProvider) ProvisionClusterNetwork(_ context.Context, _ *vmware.ClusterContext) error {
return nil
}

func (np *dummyNetworkProvider) GetClusterNetworkName(ctx context.Context, clusterCtx *vmware.ClusterContext) (string, error) {
func (np *dummyNetworkProvider) GetClusterNetworkName(_ context.Context, _ *vmware.ClusterContext) (string, error) {
return "", nil
}

func (np *dummyNetworkProvider) ConfigureVirtualMachine(ctx context.Context, clusterCtx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error {
func (np *dummyNetworkProvider) ConfigureVirtualMachine(_ context.Context, _ *vmware.ClusterContext, _ *vmoprv1.VirtualMachine) error {
return nil
}

func (np *dummyNetworkProvider) GetVMServiceAnnotations(ctx context.Context, clusterCtx *vmware.ClusterContext) (map[string]string, error) {
func (np *dummyNetworkProvider) GetVMServiceAnnotations(_ context.Context, _ *vmware.ClusterContext) (map[string]string, error) {
return map[string]string{}, nil
}

func (np *dummyNetworkProvider) VerifyNetworkStatus(ctx context.Context, clusterCtx *vmware.ClusterContext, obj runtime.Object) error {
func (np *dummyNetworkProvider) VerifyNetworkStatus(_ context.Context, _ *vmware.ClusterContext, _ runtime.Object) error {

Check warning on line 57 in pkg/services/network/dummy_provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/network/dummy_provider.go#L57

Added line #L57 was not covered by tests
return nil
}

Expand Down

0 comments on commit 0269742

Please sign in to comment.