Skip to content

Commit

Permalink
Bump github.com/golangci/golangci-lint from 1.50.1 to 1.52.1
Browse files Browse the repository at this point in the history
Signed-off-by: Prajyot-Parab <[email protected]>
  • Loading branch information
Prajyot-Parab committed Mar 22, 2023
1 parent d523cf1 commit 5823993
Show file tree
Hide file tree
Showing 26 changed files with 233 additions and 258 deletions.
4 changes: 2 additions & 2 deletions api/v1beta1/ibmvpc_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func Convert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in *infrav1b
return autoConvert_v1beta2_IBMVPCMachineSpec_To_v1beta1_IBMVPCMachineSpec(in, out, s)
}

func Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(in *[]*string, out *[]*infrav1beta2.IBMVPCResourceReference, s apiconversion.Scope) error {
func Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReference(in *[]*string, out *[]*infrav1beta2.IBMVPCResourceReference, _ apiconversion.Scope) error {
for _, sshKey := range *in {
*out = append(*out, &infrav1beta2.IBMVPCResourceReference{
ID: sshKey,
Expand All @@ -205,7 +205,7 @@ func Convert_Slice_Pointer_string_To_Slice_Pointer_v1beta2_IBMVPCResourceReferen
return nil
}

func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_string(in *[]*infrav1beta2.IBMVPCResourceReference, out *[]*string, s apiconversion.Scope) error {
func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_string(in *[]*infrav1beta2.IBMVPCResourceReference, out *[]*string, _ apiconversion.Scope) error {
if in != nil {
for _, sshKey := range *in {
if sshKey.ID != nil {
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmpowervscluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *IBMPowerVSCluster) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMPowerVSCluster) ValidateUpdate(old runtime.Object) error {
func (r *IBMPowerVSCluster) ValidateUpdate(_ runtime.Object) error {
ibmpowervsclusterlog.Info("validate update", "name", r.Name)
return r.validateIBMPowerVSCluster()
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmpowervsimage_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (r *IBMPowerVSImage) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMPowerVSImage) ValidateUpdate(old runtime.Object) error {
func (r *IBMPowerVSImage) ValidateUpdate(_ runtime.Object) error {
ibmpowervsimagelog.Info("validate update", "name", r.Name)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmpowervsmachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *IBMPowerVSMachine) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMPowerVSMachine) ValidateUpdate(old runtime.Object) error {
func (r *IBMPowerVSMachine) ValidateUpdate(_ runtime.Object) error {
ibmpowervsmachinelog.Info("validate update", "name", r.Name)
return r.validateIBMPowerVSMachine()
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmpowervsmachinetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *IBMPowerVSMachineTemplate) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMPowerVSMachineTemplate) ValidateUpdate(old runtime.Object) error {
func (r *IBMPowerVSMachineTemplate) ValidateUpdate(_ runtime.Object) error {
ibmpowervsmachinetemplatelog.Info("validate update", "name", r.Name)
return r.validateIBMPowerVSMachineTemplate()
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmvpccluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (r *IBMVPCCluster) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMVPCCluster) ValidateUpdate(old runtime.Object) error {
func (r *IBMVPCCluster) ValidateUpdate(_ runtime.Object) error {
ibmvpcclusterlog.Info("validate update", "name", r.Name)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmvpcmachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (r *IBMVPCMachine) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMVPCMachine) ValidateUpdate(old runtime.Object) error {
func (r *IBMVPCMachine) ValidateUpdate(_ runtime.Object) error {
ibmvpcmachinelog.Info("validate update", "name", r.Name)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmvpcmachinetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (r *IBMVPCMachineTemplate) ValidateCreate() error {
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
func (r *IBMVPCMachineTemplate) ValidateUpdate(old runtime.Object) error {
func (r *IBMVPCMachineTemplate) ValidateUpdate(_ runtime.Object) error {
ibmvpcmachinetemplatelog.Info("validate update", "name", r.Name)
return nil
}
Expand Down
9 changes: 2 additions & 7 deletions cmd/capibmadm/cmd/powervs/image/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand All @@ -45,10 +44,7 @@ func ListCommand() *cobra.Command {
export IBMCLOUD_API_KEY=<api-key>
capibmadm powervs image list --service-instance-id <service-instance-id> --zone <zone>`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := listimage(cmd.Context()); err != nil {
return err
}
return nil
return listimage(cmd.Context())
},
}
options.AddCommonFlags(cmd)
Expand All @@ -59,8 +55,7 @@ func listimage(ctx context.Context) error {
log := logf.Log
log.Info("Listing PowerVS images", "service-instance-id", options.GlobalOptions.ServiceInstanceID)

auth := iam.GetIAMAuth()
accountID, err := utils.GetAccountID(ctx, auth)
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/capibmadm/cmd/powervs/key/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (

"sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -89,8 +88,7 @@ func createSSHKey(ctx context.Context, keyCreateOption keyCreateOptions) error {
logger := log.Log
logger.Info("Creating SSH key...")

auth := iam.GetIAMAuth()
accountID, err := utils.GetAccountID(ctx, auth)
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/capibmadm/cmd/powervs/key/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

"sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -56,8 +55,7 @@ func deleteSSHKey(ctx context.Context, keyName string) error {
logger := log.Log
logger.Info("Deleting SSH key...")

auth := iam.GetIAMAuth()
accountID, err := utils.GetAccountID(ctx, auth)
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
8 changes: 2 additions & 6 deletions cmd/capibmadm/cmd/powervs/key/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand All @@ -44,10 +43,7 @@ func ListSSHKeyCommand() *cobra.Command {
export IBMCLOUD_API_KEY=<api-key>
capibmadm powervs key list --service-instance-id <service-instance-id> --zone <zone>`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := listSSHKeys(cmd.Context()); err != nil {
return err
}
return nil
return listSSHKeys(cmd.Context())
},
}

Expand All @@ -59,7 +55,7 @@ func listSSHKeys(ctx context.Context) error {
log := logf.Log
log.Info("Listing PowerVS SSH Keys", "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/capibmadm/cmd/powervs/network/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -84,7 +83,7 @@ func createNetwork(ctx context.Context, netCreateOption networkCreateOptions) er
log := logf.Log
log.Info("Creating PowerVS network", "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/capibmadm/cmd/powervs/network/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -56,7 +55,7 @@ func deleteNetwork(ctx context.Context, networkID string) error {
log := logf.Log
log.Info("Deleting PowerVS network", "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/capibmadm/cmd/powervs/network/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand Down Expand Up @@ -56,7 +55,7 @@ func listNetwork(ctx context.Context) error {
log := logf.Log
log.Info("Listing PowerVS networks", "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
8 changes: 2 additions & 6 deletions cmd/capibmadm/cmd/powervs/port/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

"sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand Down Expand Up @@ -57,10 +56,7 @@ capibmadm powervs port create --network <netword-id/network-name> --description
cmd.Flags().StringVar(&portCreateOption.ipAddress, "ip-address", "", "IP Address to be assigned to the port")
cmd.Flags().StringVar(&portCreateOption.description, "description", "", "Description of the port")
cmd.RunE = func(cmd *cobra.Command, args []string) error {
if err := createPort(cmd.Context(), portCreateOption); err != nil {
return err
}
return nil
return createPort(cmd.Context(), portCreateOption)
}
options.AddCommonFlags(cmd)
_ = cmd.MarkFlagRequired("network")
Expand All @@ -70,7 +66,7 @@ capibmadm powervs port create --network <netword-id/network-name> --description
func createPort(ctx context.Context, portCreateOption portCreateOptions) error {
logger := log.Log
logger.Info("Creating Port ", "Network ID/Name", portCreateOption.network, "IP Address", portCreateOption.ipAddress, "Description", portCreateOption.description, "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)
accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
9 changes: 2 additions & 7 deletions cmd/capibmadm/cmd/powervs/port/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -54,19 +53,15 @@ capibmadm powervs port delete --port-id <port-id> --network <network-name/networ
_ = cmd.MarkFlagRequired("network")

cmd.RunE = func(cmd *cobra.Command, args []string) error {
if err := deletePort(cmd.Context(), portDeleteOption); err != nil {
return err
}
return nil
return deletePort(cmd.Context(), portDeleteOption)
}
return cmd
}

func deletePort(ctx context.Context, portDeleteOption portDeleteOptions) error {
log := logf.Log
log.Info("Deleting PowerVS network port", "network", portDeleteOption.network, "service-instance-id", options.GlobalOptions.ServiceInstanceID, "port-id", portDeleteOption.portID)
auth := iam.GetIAMAuth()
accountID, err := utils.GetAccountID(ctx, auth)
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
4 changes: 1 addition & 3 deletions cmd/capibmadm/cmd/powervs/port/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/powervs"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand Down Expand Up @@ -62,8 +61,7 @@ func listPorts(ctx context.Context, network string) error {
log := logf.Log
log.Info("Listing PowerVS ports", "service-instance-id", options.GlobalOptions.ServiceInstanceID, "network", network)

auth := iam.GetIAMAuth()
accountID, err := utils.GetAccountID(ctx, auth)
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
8 changes: 2 additions & 6 deletions cmd/capibmadm/cmd/vpc/image/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

"github.com/IBM/vpc-go-sdk/vpcv1"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/vpc"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/printer"
Expand All @@ -47,10 +46,7 @@ func ListCommand() *cobra.Command {
options.AddCommonFlags(cmd)

cmd.RunE = func(cmd *cobra.Command, args []string) error {
if err := listImages(cmd.Context(), options.GlobalOptions.ResourceGroupName); err != nil {
return err
}
return nil
return listImages(cmd.Context(), options.GlobalOptions.ResourceGroupName)
}

return cmd
Expand All @@ -62,7 +58,7 @@ func listImages(ctx context.Context, resourceGroupName string) error {
return err
}

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/capibmadm/cmd/vpc/key/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"

"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/iam"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/clients/vpc"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/options"
"sigs.k8s.io/cluster-api-provider-ibmcloud/cmd/capibmadm/utils"
Expand Down Expand Up @@ -92,7 +91,7 @@ func createKey(ctx context.Context, keyCreateOption keyCreateOptions) error {
return err
}

accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
accountID, err := utils.GetAccountID(ctx)
if err != nil {
return err
}
Expand Down
5 changes: 1 addition & 4 deletions cmd/capibmadm/cmd/vpc/key/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ capibmadm vpc key list --region <region> --resource-group-name <resource-group-n
options.AddCommonFlags(cmd)

cmd.RunE = func(cmd *cobra.Command, args []string) error {
if err := listKeys(cmd.Context()); err != nil {
return err
}
return nil
return listKeys(cmd.Context())
}

return cmd
Expand Down
3 changes: 1 addition & 2 deletions cmd/capibmadm/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/go-openapi/strfmt"

"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
"github.com/IBM/platform-services-go-sdk/resourcemanagerv2"

Expand All @@ -32,7 +31,7 @@ import (
)

// GetAccountID returns IBM cloud account ID of API key used.
func GetAccountID(ctx context.Context, auth *core.IamAuthenticator) (string, error) {
func GetAccountID(ctx context.Context) (string, error) {
iamv1, err := platformservices.NewIAMIdentityClient()
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(GO_APIDIFF): $(BIN_DIR) go.mod go.sum ## Build a local copy of go-apidiff.

GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
$(GOLANGCI_LINT): $(BIN_DIR) go.mod go.sum ## Build a local copy of golangci-lint.
go build -tags=tools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint
go build -tags=capibmtools -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint

GOTESTSUM := $(BIN_DIR)/gotestsum
$(GOTESTSUM): $(BIN_DIR) go.mod go.sum
Expand Down
Loading

0 comments on commit 5823993

Please sign in to comment.