Skip to content

Commit

Permalink
Merge pull request #361 from mjura/v2.8-go
Browse files Browse the repository at this point in the history
[v2.8] Bump go version to 1.21
  • Loading branch information
mjura committed Feb 9, 2024
2 parents 0350dd7 + 55a860e commit 2f54a1a
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 1 addition & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 1 addition & 9 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/update-rancher-dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bin/
dist/
.dapper
_artifacts/
vendor/
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; \
Expand Down
6 changes: 3 additions & 3 deletions controller/eks-cluster-config-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/Dockerfile.e2e
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ 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 {
return fmt.Errorf("failed to substitute cert manager chart url: %w", err)
}
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 {
Expand Down

0 comments on commit 2f54a1a

Please sign in to comment.