diff --git a/.github/workflows/apidiff.yaml b/.github/workflows/apidiff.yaml index c3dc6181..587b5604 100644 --- a/.github/workflows/apidiff.yaml +++ b/.github/workflows/apidiff.yaml @@ -10,5 +10,5 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.21.x - uses: joelanford/go-apidiff@main diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e3230cdf..f50373dc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,14 +15,6 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x - - uses: actions/cache@v3.3.1 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-build-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-build-go-${{ hashFiles('**/go.sum') }} + go-version: 1.21.x - name: Build run: make operator diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index fe4878f7..c91f68d3 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -57,15 +57,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x - - uses: actions/cache@v3.3.1 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} + go-version: 1.21.x - uses: engineerd/setup-kind@v0.5.0 with: version: "v0.16.0" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a477538e..667960ea 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x + go-version: 1.21.x - name: Analysis uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index ddb927e6..f107d1f3 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -12,15 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x - - uses: actions/cache@v3.3.1 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} + go-version: 1.21.x - name: Run tests run: | make test diff --git a/.github/workflows/update-rancher-dep.yaml b/.github/workflows/update-rancher-dep.yaml index 22fad9d3..d9ff72b6 100644 --- a/.github/workflows/update-rancher-dep.yaml +++ b/.github/workflows/update-rancher-dep.yaml @@ -18,7 +18,7 @@ on: env: GOARCH: amd64 CGO_ENABLED: 0 - SETUP_GO_VERSION: '1.19.*' + SETUP_GO_VERSION: '1.21.*' jobs: create-rancher-pr: diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 012458d7..06c5aafe 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -12,15 +12,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x - - uses: actions/cache@v3.3.1 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} + go-version: 1.21.x - name: Run make verify run: | make verify diff --git a/.gitignore b/.gitignore index 84bab86f..f465a9ec 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ bin/ dist/ .dapper _artifacts/ +vendor/ diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 5c73f834..51907ae2 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -8,7 +8,7 @@ RUN zypper -n update && \ ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH_arm64=arm64 GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash -RUN curl -sLf https://storage.googleapis.com/golang/go1.19.3.linux-${ARCH}.tar.gz | tar -xzf - -C /usr/local/ +RUN curl -sLf https://storage.googleapis.com/golang/go1.21.7.linux-${ARCH}.tar.gz | tar -xzf - -C /usr/local/ # workaround for https://bugzilla.suse.com/show_bug.cgi?id=1183043 RUN if [ "${ARCH}" == "arm64" ]; then \ zypper -n install binutils-gold ; \ diff --git a/controller/eks-cluster-config-handler.go b/controller/eks-cluster-config-handler.go index c474fe50..6bcf19cc 100644 --- a/controller/eks-cluster-config-handler.go +++ b/controller/eks-cluster-config-handler.go @@ -634,16 +634,16 @@ func (h *Handler) generateAndSetNetworking(config *eksv1.EKSClusterConfig, awsSV } virtualNetworkString := getParameterValueFromOutput("VpcId", stack.Stacks[0].Outputs) - subnetIdsString := getParameterValueFromOutput("SubnetIds", stack.Stacks[0].Outputs) + subnetIDsString := getParameterValueFromOutput("SubnetIds", stack.Stacks[0].Outputs) - if subnetIdsString == "" { + if subnetIDsString == "" { return config, fmt.Errorf("no subnet ids were returned") } config = config.DeepCopy() // copy generated field to status config.Status.VirtualNetwork = virtualNetworkString - config.Status.Subnets = strings.Split(subnetIdsString, ",") + config.Status.Subnets = strings.Split(subnetIDsString, ",") config.Status.NetworkFieldsSource = "generated" } diff --git a/go.mod b/go.mod index fb50ec0a..6002c862 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/rancher/eks-operator -go 1.20 +go 1.21 + +toolchain go1.21.6 replace k8s.io/client-go => k8s.io/client-go v0.28.6 diff --git a/go.sum b/go.sum index b0017453..11b1ca61 100644 --- a/go.sum +++ b/go.sum @@ -83,6 +83,7 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -443,6 +444,7 @@ go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= 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.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -652,6 +654,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc= +gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= diff --git a/test/e2e/Dockerfile.e2e b/test/e2e/Dockerfile.e2e index 2c34acd6..6f18feee 100644 --- a/test/e2e/Dockerfile.e2e +++ b/test/e2e/Dockerfile.e2e @@ -1,4 +1,4 @@ -FROM registry.suse.com/bci/golang:1.19 AS build +FROM registry.suse.com/bci/golang:1.21 AS build RUN zypper -n install -l openssl-devel WORKDIR /src COPY go.mod go.sum /src/ diff --git a/test/e2e/config/config.go b/test/e2e/config/config.go index c0f7d2a4..36762bd6 100644 --- a/test/e2e/config/config.go +++ b/test/e2e/config/config.go @@ -119,7 +119,7 @@ func ReadE2EConfig(configPath string) (*E2EConfig, error) { //nolint:gocyclo } func substituteVersions(config *E2EConfig) error { - certManagerURL, err := envsubst.Eval(config.CertManagerChartURL, func(s string) string { + certManagerURL, err := envsubst.Eval(config.CertManagerChartURL, func(_ string) string { return config.CertManagerVersion }) if err != nil { @@ -127,7 +127,7 @@ func substituteVersions(config *E2EConfig) error { } config.CertManagerChartURL = certManagerURL - rancherURL, err := envsubst.Eval(config.RancherChartURL, func(s string) string { + rancherURL, err := envsubst.Eval(config.RancherChartURL, func(_ string) string { return config.RancherVersion }) if err != nil {