From 8994eb731357c6965eaf1ab91b58553aabbfd986 Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 15:33:08 -0300 Subject: [PATCH 1/7] bump go version to 1.20 Signed-off-by: Andre Ferraz --- Dockerfile | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 From 41f7e9e0fc023528ec321f535739bcc8a29032d2 Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 15:36:21 -0300 Subject: [PATCH 2/7] change golang version in actions to 1.20 Signed-off-by: Andre Ferraz --- .github/workflows/ci-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 445b0ba2..dffaaefb 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -18,7 +18,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v1 with: - go-version: '1.18' + go-version: '1.20' - name: Download all Go modules run: | go mod download @@ -68,7 +68,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v1 with: - go-version: '1.18' + go-version: '1.20' - name: Run tests env: GNUPG_DISABLED: true From ff502a5bcdac3ccbb76d546ea803d30a7ae57842 Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 15:43:06 -0300 Subject: [PATCH 3/7] bump golangci-lint-action and setup-go to v3 Signed-off-by: Andre Ferraz --- .github/workflows/ci-tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index dffaaefb..984f7031 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -16,7 +16,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Setup Golang - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: go-version: '1.20' - name: Download all Go modules @@ -55,7 +55,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Run golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.46.2 args: --timeout 5m @@ -66,7 +66,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Setup Golang - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: go-version: '1.20' - name: Run tests From 8f34cf85c8b48ec408796fb7a51085d0f459f19d Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 15:46:08 -0300 Subject: [PATCH 4/7] change actions/checkout to v3 Signed-off-by: Andre Ferraz --- .github/workflows/ci-tests.yaml | 8 ++++---- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/image.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 984f7031..2683dfa8 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Golang uses: actions/setup-go@v3 with: @@ -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,7 +53,7 @@ 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@v3 with: @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Golang uses: actions/setup-go@v3 with: 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 From 0849c669d2c0afff3d088626c1496507d8e2c2ab Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 15:50:12 -0300 Subject: [PATCH 5/7] bump golangci-lint-action to v1.52.2 Signed-off-by: Andre Ferraz --- .github/workflows/ci-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml index 2683dfa8..46abe210 100644 --- a/.github/workflows/ci-tests.yaml +++ b/.github/workflows/ci-tests.yaml @@ -57,7 +57,7 @@ jobs: - name: Run golangci-lint 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 From 7b71a20fa34ef735ce8758926dd700012b6b73f8 Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 16:02:40 -0300 Subject: [PATCH 6/7] these 3 linters were deprecated in favor of unused Signed-off-by: Andre Ferraz --- .golangci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 From a665b4f678ec5e4c5a0da13c27f0bbe60509ba3a Mon Sep 17 00:00:00 2001 From: Andre Ferraz Date: Mon, 8 May 2023 16:25:15 -0300 Subject: [PATCH 7/7] go linter fix Signed-off-by: Andre Ferraz --- ext/git/client.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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{