Skip to content

Commit

Permalink
Bump golang 1.20 => 1.21
Browse files Browse the repository at this point in the history
Signed-off-by: Aniruddha Basak <aniruddha.basak@syself.com>

Fix review

Signed-off-by: Aniruddha Basak <aniruddha.basak@syself.com>

:seedling: fix builder-image and some other minor fixes

golangci-lint fix and comments

Signed-off-by: Anurag <contact.anurag7@gmail.com>

update golangci-lint fixes and add comments

Signed-off-by: Anurag <contact.anurag7@gmail.com>
  • Loading branch information
aniruddha2000 authored and kranurag7 committed Sep 26, 2023
1 parent f8d55ea commit 141ee65
Show file tree
Hide file tree
Showing 23 changed files with 64 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .builder-image-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.7
1.0.8
4 changes: 2 additions & 2 deletions .github/actions/manager-image/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:
# Import GitHub's cache build to docker cache
- name: Copy Caph Golang cache to docker cache
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
provenance: false
context: /tmp/.cache/caph
Expand All @@ -54,7 +54,7 @@ runs:
target: import-cache

- name: Build and push manager image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
with:
provenance: false
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/metadata/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
steps:
- name: Docker manager metadata
id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: ${{ inputs.metadata_flavor }}
Expand Down
4 changes: 2 additions & 2 deletions .github/renovate/golang.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
// https://docs.renovatebot.com/configuration-options/#constraints
"constraints": {
"go": "1.20"
"go": "1.21"
},
packageRules: [
{
Expand Down Expand Up @@ -41,4 +41,4 @@
enabled: false,
},
],
}
}
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
# Import GitHub's cache build to docker cache
- name: Copy Caph Golang cache to docker cache
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
provenance: false
context: /tmp/.cache/caph
Expand All @@ -91,7 +91,7 @@ jobs:
target: import-cache

- name: Build and push manager image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
id: docker_build_release
with:
provenance: false
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
# Store docker's golang's cache build locally only on the main branch
- name: Store Caph Golang cache build locally
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
provenance: false
context: .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-promote-builder-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Promote Latest tag to Caph Builder Image
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.7
image: ghcr.io/syself/caph-builder:1.0.8
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event_name != 'pull_request_target' || !github.event.pull_request.draft
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.7
image: ghcr.io/syself/caph-builder:1.0.8
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
echo 'EOF' >> $GITHUB_ENV
- name: Build and push manager image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
id: docker_build_release
with:
provenance: false
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/schedule-cache-cleaner-caph-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ concurrency:
cancel-in-progress: true
jobs:
cache-cleaner:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: symin
runs-on: ubuntu-20.04
steps:
# Load Golang cache build from GitHub
- name: Load Caph Golang cache build from GitHub
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-scan-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Trivy
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.7
image: ghcr.io/syself/caph-builder:1.0.8
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
19 changes: 13 additions & 6 deletions .golangci-suggestions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ linters-settings:
allow-leading-space: false
require-specific: true
staticcheck:
go: "1.20"
go: "1.21"
stylecheck:
go: "1.20"
go: "1.21"
gocritic:
enabled-tags:
- diagnostic
Expand Down Expand Up @@ -151,7 +151,14 @@ linters-settings:
severity: warning
disabled: false
arguments:
- ["call-chain", "loop", "method-call", "recover", "immediate-recover", "return"] # yamllint disable-line rule:line-length
- [
"call-chain",

Check failure on line 155 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

155:15 [indentation] wrong indentation: expected 12 but found 14
"loop",

Check failure on line 156 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

156:15 [indentation] wrong indentation: expected 12 but found 14
"method-call",

Check failure on line 157 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

157:15 [indentation] wrong indentation: expected 12 but found 14
"recover",

Check failure on line 158 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

158:15 [indentation] wrong indentation: expected 12 but found 14
"immediate-recover",

Check failure on line 159 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

159:15 [indentation] wrong indentation: expected 12 but found 14
"return",

Check failure on line 160 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

160:15 [indentation] wrong indentation: expected 12 but found 14
] # yamllint disable-line rule:line-length

Check failure on line 161 in .golangci-suggestions.yaml

View workflow job for this annotation

GitHub Actions / Lint Pull Request

161:13 [indentation] wrong indentation: expected 10 but found 12
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
- name: exported
severity: warning
Expand Down Expand Up @@ -218,7 +225,7 @@ linters-settings:
- ["ID"] # AllowList
- ["VM"] # DenyList
unused:
go: "1.20"
go: "1.21"
usestdlibvars:
# Suggest the use of http.MethodXX.
# Default: true
Expand Down Expand Up @@ -276,8 +283,8 @@ issues:
exclude-use-default: false
run:
timeout: 10m
go: "1.20"
go: "1.21"
allow-parallel-runners: true
modules-download-mode: vendor
skip-dirs:
- vendor$
- vendor$
8 changes: 4 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ linters-settings:
allow-leading-space: false
require-specific: true
staticcheck:
go: "1.20"
go: "1.21"
stylecheck:
go: "1.20"
go: "1.21"
gosec:
excludes:
- G307 # Deferring unsafe method "Close" on type "\*os.File"
Expand Down Expand Up @@ -111,7 +111,7 @@ linters-settings:
- rangeValCopy
- hugeParam
unused:
go: "1.20"
go: "1.21"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down Expand Up @@ -205,4 +205,4 @@ run:
- "tilt_modules"
- "test"
allow-parallel-runners: true
modules-download-mode: readonly
modules-download-mode: readonly
4 changes: 2 additions & 2 deletions controllers/hcloudmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (r *HCloudMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl
return fmt.Errorf("error creating controller: %w", err)
}

clusterToObjectFunc, err := util.ClusterToObjectsMapper(r.Client, &infrav1.HCloudMachineList{}, mgr.GetScheme())
clusterToObjectFunc, err := util.ClusterToTypedObjectsMapper(r.Client, &infrav1.HCloudMachineList{}, mgr.GetScheme())
if err != nil {
return fmt.Errorf("failed to create mapper for Cluster to HCloudMachines: %w", err)
}
Expand Down Expand Up @@ -303,6 +303,7 @@ func (r *HCloudMachineReconciler) HetznerClusterToHCloudMachines(_ context.Conte
}
}

// IgnoreHetznerClusterConditionUpdates is a predicate used for ignoring HetznerCluster condition updates.
func IgnoreHetznerClusterConditionUpdates(logger logr.Logger) predicate.Funcs {
return predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
Expand Down Expand Up @@ -344,7 +345,6 @@ func IgnoreHetznerClusterConditionUpdates(logger logr.Logger) predicate.Funcs {
// Only insignificant fields changed, no need to reconcile
log.V(1).Info("Update to resource only changes insignificant fields, will not enqueue event")
return false

}
// There is a noteworthy diff, so we should reconcile
log.V(1).Info("Update to resource changes significant fields, will enqueue event")
Expand Down
11 changes: 6 additions & 5 deletions controllers/hcloudmachinetemplate_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ import (
"fmt"
"time"

infrav1 "github.com/syself/cluster-api-provider-hetzner/api/v1beta1"
"github.com/syself/cluster-api-provider-hetzner/pkg/scope"
secretutil "github.com/syself/cluster-api-provider-hetzner/pkg/secrets"
hcloudclient "github.com/syself/cluster-api-provider-hetzner/pkg/services/hcloud/client"
"github.com/syself/cluster-api-provider-hetzner/pkg/services/hcloud/machinetemplate"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog/v2"
Expand All @@ -40,6 +35,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

infrav1 "github.com/syself/cluster-api-provider-hetzner/api/v1beta1"
"github.com/syself/cluster-api-provider-hetzner/pkg/scope"
secretutil "github.com/syself/cluster-api-provider-hetzner/pkg/secrets"
hcloudclient "github.com/syself/cluster-api-provider-hetzner/pkg/services/hcloud/client"
"github.com/syself/cluster-api-provider-hetzner/pkg/services/hcloud/machinetemplate"
)

// HCloudMachineTemplateReconciler reconciles a HCloudMachineTemplate object.
Expand Down
2 changes: 1 addition & 1 deletion controllers/hetznerbaremetalmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (r *HetznerBareMetalMachineReconciler) SetupWithManager(ctx context.Context
return fmt.Errorf("error creating controller: %w", err)
}

clusterToObjectFunc, err := util.ClusterToObjectsMapper(r.Client, &infrav1.HetznerBareMetalMachineList{}, mgr.GetScheme())
clusterToObjectFunc, err := util.ClusterToTypedObjectsMapper(r.Client, &infrav1.HetznerBareMetalMachineList{}, mgr.GetScheme())
if err != nil {
return fmt.Errorf("failed to create mapper for Cluster to BareMetalMachines: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/syself/cluster-api-provider-hetzner

go 1.20
go 1.21

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.0

Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
Expand Down Expand Up @@ -138,6 +139,7 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
Expand Down Expand Up @@ -310,6 +312,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -346,13 +349,15 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
Expand Down Expand Up @@ -403,6 +408,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
Expand Down Expand Up @@ -488,6 +494,7 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
Expand Down Expand Up @@ -878,6 +885,7 @@ gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
10 changes: 5 additions & 5 deletions hack/golang-modules-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ cd "${REPO_ROOT}" || exit 1

DIRS="./ ./hack/tools"
for DIR in ${DIRS}; do
cd ${REPO_ROOT}/${DIR} && go mod download
cd ${REPO_ROOT}/${DIR} && go mod verify
cd ${REPO_ROOT}/${DIR} && go mod tidy
cd ${REPO_ROOT}/${DIR} && go mod vendor
done
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod verify
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod tidy
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod vendor
done
6 changes: 1 addition & 5 deletions hack/upgrade-builder-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ set -o errexit
set -o nounset
set -o pipefail

if [ -z "${BUILDER_IMAGE:-}" ]; then
echo "Please provide BUILDER_IMAGE as env var"
exit 1
fi

export BUILDER_IMAGE=ghcr.io/syself/caph-builder

REPO_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)
cd "${REPO_ROOT}" || exit 1
Expand Down
8 changes: 4 additions & 4 deletions images/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apk add --no-cache curl && \
FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as golangci
# update: datasource=github-tags depName=golangci/golangci-lint versioning=semver
ENV GOLANGCI_VERSION="v1.52.2"
WORKDIR /
WORKDIR /
# hadolint ignore=DL3018,DL4006
RUN apk add --no-cache curl && \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_VERSION}
Expand All @@ -45,7 +45,7 @@ FROM docker.io/aquasec/trivy:0.39.0@sha256:ab281f43ee11b8ea5443ca8897641441f04f1
############################
# Caph Build Image Base #
############################
FROM docker.io/library/golang:1.20.2-bullseye@sha256:2101aa981e68ab1e06e3d4ac35ae75ed122f0380e5331e3ae4ba7e811bf9d256
FROM docker.io/library/golang:1.21.1-bullseye@sha256:357be9f9e594a338ba16f54c4df16481e7e82533a6571cecaf22dca833622f91

# update: datasource=repology depName=debian_11/skopeo versioning=loose
ENV SKOPEO_VERSION="1.2.2+dfsg1-1+b6"
Expand All @@ -65,7 +65,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
pip install --no-cache-dir \
yamllint==${YAMLLINT_VERSION} \
yamlfixer-opt-nc==${YAMLFIXER_VERSION}
yamlfixer-opt-nc==${YAMLFIXER_VERSION}

COPY --from=lychee /usr/bin/lychee /usr/bin/lychee
COPY --from=golangci /bin/golangci-lint /usr/local/bin
Expand All @@ -76,4 +76,4 @@ ENV GOCACHE=/go/cache

COPY build.sh /
RUN chmod +x /build.sh
ENTRYPOINT ["/build.sh"]
ENTRYPOINT ["/build.sh"]
Loading

0 comments on commit 141ee65

Please sign in to comment.