From 0d9feeb888dfee9ad888f60ecae199a505b1e015 Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Tue, 26 Nov 2024 22:46:23 +0000 Subject: [PATCH] fix linting --- .github/workflows/ci.yml | 9 ++++++--- cloud/linode/cloud.go | 2 +- main.go | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49d76d9a..3975953c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,7 @@ jobs: cli.codecov.io:443 api.codecov.io:443 raw.githubusercontent.com:443 + get.helm.sh:443 - uses: actions/checkout@v4 with: @@ -69,8 +70,10 @@ jobs: - name: Vet run: make vet - - name: Lint - run: make lint + - name: lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest - name: Helm Lint run: make helm-lint @@ -79,7 +82,7 @@ jobs: run: make test - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v4 with: files: ./coverage.out fail_ci_if_error: true diff --git a/cloud/linode/cloud.go b/cloud/linode/cloud.go index b85f6191..e9ac261b 100644 --- a/cloud/linode/cloud.go +++ b/cloud/linode/cloud.go @@ -117,7 +117,7 @@ func newCloud() (cloudprovider.Interface, error) { if len(Options.IpHolderSuffix) > 23 { msg := fmt.Sprintf("ip-holder-suffix must be 23 characters or less: %s is %d characters\n", Options.IpHolderSuffix, len(Options.IpHolderSuffix)) klog.Error(msg) - return nil, fmt.Errorf(msg) + return nil, fmt.Errorf("%s", msg) } // create struct that satisfies cloudprovider.Interface diff --git a/main.go b/main.go index dde9feb8..53b5b2ab 100644 --- a/main.go +++ b/main.go @@ -113,7 +113,7 @@ func main() { linode.Options.KubeconfigFlag = command.Flags().Lookup("kubeconfig") if linode.Options.KubeconfigFlag == nil { msg := "kubeconfig missing from CCM flag set" - sentry.CaptureError(ctx, fmt.Errorf(msg)) + sentry.CaptureError(ctx, fmt.Errorf("%s", msg)) fmt.Fprintf(os.Stderr, "kubeconfig missing from CCM flag set"+"\n") os.Exit(1) } @@ -122,7 +122,7 @@ func main() { _, network, err := net.ParseCIDR(externalSubnet) if err != nil { msg := fmt.Sprintf("Unable to parse %s as network subnet: %v", externalSubnet, err) - sentry.CaptureError(ctx, fmt.Errorf(msg)) + sentry.CaptureError(ctx, fmt.Errorf("%s", msg)) fmt.Fprintf(os.Stderr, "%v\n", msg) os.Exit(1) }