diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 445b0ba2..46abe210 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -14,11 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Golang - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: - go-version: '1.18' + go-version: '1.20' - name: Download all Go modules run: | go mod download @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Kustomize v2 run: | set -xo pipefail @@ -53,22 +53,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Run golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - version: v1.46.2 + version: v1.52.2 args: --timeout 5m test: name: Ensure unit tests are passing runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Golang - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: - go-version: '1.18' + go-version: '1.20' - name: Run tests env: GNUPG_DISABLED: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b189361a..464bba6d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 501406cd..4758984a 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: argocd-image-updater - name: Setup qemu diff --git a/.golangci.yml b/.golangci.yml index 440adbd1..fb4e97b3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,13 +7,11 @@ run: linters: enable: - vet - - deadcode - goimports - - varcheck - - structcheck - ineffassign - unconvert - unparam + - unused linters-settings: goimports: local-prefixes: github.com/argoproj-labs/argocd-image-updater diff --git a/Dockerfile b/Dockerfile index d5acc3d0..ec38e462 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18 AS builder +FROM golang:1.20 AS builder RUN mkdir -p /src/argocd-image-updater WORKDIR /src/argocd-image-updater diff --git a/ext/git/client.go b/ext/git/client.go index fa470bcc..11a9a758 100644 --- a/ext/git/client.go +++ b/ext/git/client.go @@ -155,12 +155,12 @@ func NewClientExt(rawRepoURL string, root string, creds Creds, insecure bool, en // Returns a HTTP client object suitable for go-git to use using the following // pattern: -// - If insecure is true, always returns a client with certificate verification -// turned off. -// - If one or more custom certificates are stored for the repository, returns -// a client with those certificates in the list of root CAs used to verify -// the server's certificate. -// - Otherwise (and on non-fatal errors), a default HTTP client is returned. +// - If insecure is true, always returns a client with certificate verification +// turned off. +// - If one or more custom certificates are stored for the repository, returns +// a client with those certificates in the list of root CAs used to verify +// the server's certificate. +// - Otherwise (and on non-fatal errors), a default HTTP client is returned. func GetRepoHTTPClient(repoURL string, insecure bool, creds Creds, proxyURL string) *http.Client { // Default HTTP client var customHTTPClient = &http.Client{ diff --git a/go.mod b/go.mod index 23f1efe7..36591125 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/argoproj-labs/argocd-image-updater -go 1.18 +go 1.20 require ( github.com/Masterminds/semver v1.5.0