From 26f8c294583bb232027f59de5aa7b35e9fa8b330 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Thu, 9 Jan 2025 18:35:22 -0600 Subject: [PATCH] Upgrade to go 1.22 --- .dockerignore | 28 +++--- .github/actions/setup-build/action.yaml | 6 +- .../workflows/build-all-distros-nightly.yaml | 49 ----------- .github/workflows/cache-dependencies.yaml | 20 ----- .github/workflows/ecr-publish-build.yaml | 38 -------- .github/workflows/ecr-publish.yaml | 2 +- .github/workflows/test-and-build.yaml | 13 +-- .golangci.yml | 2 +- .requirements | 15 ---- CONTRIBUTING.md | 15 +--- Dockerfile | 26 +++--- Makefile | 15 ++-- Makefile.common | 2 - Makefile.docker | 87 ------------------- build/build_image_manifest | 4 - build/docker/Dockerfile | 56 ------------ build/docker/build_image_manifest | 18 ---- build/docker/image_tag | 1 - build/scripts/build-image-manifest.sh | 21 ----- build/scripts/install-build-deps.sh | 27 ------ go.mod | 30 +++---- go.sum | 28 +++++- pkg/awsapi/eks.go | 2 + pkg/awsapi/outposts.go | 4 +- pkg/eks/mocksv2/EKS.go | 74 ++++++++++++++++ 25 files changed, 163 insertions(+), 420 deletions(-) delete mode 100644 .github/workflows/build-all-distros-nightly.yaml delete mode 100644 .github/workflows/cache-dependencies.yaml delete mode 100644 .github/workflows/ecr-publish-build.yaml delete mode 100644 .requirements delete mode 100644 Makefile.docker delete mode 100644 build/build_image_manifest delete mode 100644 build/docker/Dockerfile delete mode 100644 build/docker/build_image_manifest delete mode 100644 build/docker/image_tag delete mode 100755 build/scripts/build-image-manifest.sh delete mode 100755 build/scripts/install-build-deps.sh diff --git a/.dockerignore b/.dockerignore index 527874dac7..fff06f81dc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,14 +1,14 @@ -* -!.git -!.goreleaser* -!.golangci* -!.mockery.yaml -!build/scripts -!cmd -!examples -!go.* -!integration -!LICENSE -!Makefile* -!pkg -!tools.go +.editorconfig +.dockerignore +.github +.gitignore +*.md +*.toml +docs +eksctl +examples +logo +userdocs +CNAME +DCO +LICENSE diff --git a/.github/actions/setup-build/action.yaml b/.github/actions/setup-build/action.yaml index 9add45c7be..df36eacc50 100644 --- a/.github/actions/setup-build/action.yaml +++ b/.github/actions/setup-build/action.yaml @@ -8,7 +8,7 @@ runs: - name: Setup Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5.0.0 with: - go-version: 1.21.x + go-version: 1.22.x cache: false - name: Cache go-build and mod uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 #v4.0.0 @@ -19,7 +19,3 @@ runs: key: go-${{ hashFiles('go.sum') }} restore-keys: | go- - - name: Setup deps - shell: bash - run: | - make install-build-deps \ No newline at end of file diff --git a/.github/workflows/build-all-distros-nightly.yaml b/.github/workflows/build-all-distros-nightly.yaml deleted file mode 100644 index db73675844..0000000000 --- a/.github/workflows/build-all-distros-nightly.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build all distros -on: - schedule: - - cron: '0 9 * * 1-5' - workflow_dispatch: {} - -jobs: - build-all-distros: - name: build all distros - runs-on: ubuntu-latest - steps: - - name: Clean unncessary files to save space - run: | - docker rmi `docker images -q` - sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo apt clean - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df -h - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be #v1.3.1 - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: false - large-packages: true - swap-storage: true - - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - with: - fetch-depth: 0 - - name: Setup build environment - uses: ./.github/actions/setup-build - - - name: Build image - run: | - EKSCTL_IMAGE_VERSION=${GITHUB_REF#refs/*/} make -f Makefile.docker eksctl-image - - - name: Generate artifacts - run: | - make generate-always - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf #v6.1.0 - with: - version: v1.24.0 - args: --config=.github/.goreleaser-local.yaml --snapshot --skip=publish --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cache-dependencies.yaml b/.github/workflows/cache-dependencies.yaml deleted file mode 100644 index df68c33dc5..0000000000 --- a/.github/workflows/cache-dependencies.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Cache Dependencies -on: - push: - branches: - - main - -jobs: - cache-dependencies: - name: Cache dependencies - runs-on: ubuntu-latest - steps: - - name: Cache Go modules - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 - with: - path: | - ~/.cache/go-build/ - ~/go/pkg/mod/ - key: go-${{ hashFiles('go.sum') }} - restore-keys: | - go- diff --git a/.github/workflows/ecr-publish-build.yaml b/.github/workflows/ecr-publish-build.yaml deleted file mode 100644 index 1e9a5ac923..0000000000 --- a/.github/workflows/ecr-publish-build.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish ECR eksctl-build image - -on: workflow_dispatch - -permissions: - id-token: write - contents: read - -jobs: - build-and-push-to-registry: - name: Build and push container image - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - with: - fetch-depth: 0 - - - name: Setup build environment - uses: ./.github/actions/setup-build - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - aws-region: us-east-1 - role-duration-seconds: 7200 - role-session-name: eksctl-build-ecr-publisher - role-to-assume: ${{ secrets.ECR_PUBLISH_ROLE_ARN }} - - - name: Login to Amazon ECR Public - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v1 - with: - registry-type: public - - - name: Build and push image - run: | - PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker push-build-image \ No newline at end of file diff --git a/.github/workflows/ecr-publish.yaml b/.github/workflows/ecr-publish.yaml index c493a4fa17..b82bc8923c 100644 --- a/.github/workflows/ecr-publish.yaml +++ b/.github/workflows/ecr-publish.yaml @@ -46,4 +46,4 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/test-and-build.yaml b/.github/workflows/test-and-build.yaml index c75f0d7d13..c936335512 100644 --- a/.github/workflows/test-and-build.yaml +++ b/.github/workflows/test-and-build.yaml @@ -32,6 +32,7 @@ jobs: - name: Lint run: | PATH=$PATH:$(go env GOPATH)/bin make lint + image: name: Build and check image runs-on: ubuntu-latest @@ -40,8 +41,10 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 with: fetch-depth: 0 - - name: Setup build environment - uses: ./.github/actions/setup-build - - name: build - run: | - PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker check-build-image-manifest-up-to-date + - name: Build image + id: push + uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc #v6.11.0 + with: + context: . + file: ./Dockerfile + push: false diff --git a/.golangci.yml b/.golangci.yml index da2c7235f5..9e2bfe4cb1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ # options for analysis running run: - go: "1.21" + go: "1.22" # default concurrency is a available CPU number concurrency: 4 diff --git a/.requirements b/.requirements deleted file mode 100644 index 06375e647b..0000000000 --- a/.requirements +++ /dev/null @@ -1,15 +0,0 @@ -github.com/maxbrunsfeld/counterfeiter/v6 -github.com/cloudflare/cfssl/cmd/cfssl@v1.6.4 -github.com/cloudflare/cfssl/cmd/cfssljson@v1.6.4 -github.com/golangci/golangci-lint/cmd/golangci-lint -github.com/onsi/ginkgo/v2/ginkgo@v2.12.1 -github.com/vektra/mockery/v2 -github.com/github-release/github-release -golang.org/x/tools/cmd/stringer -k8s.io/code-generator/cmd/client-gen -k8s.io/code-generator/cmd/deepcopy-gen -k8s.io/code-generator/cmd/defaulter-gen -k8s.io/code-generator/cmd/informer-gen -k8s.io/code-generator/cmd/lister-gen -sigs.k8s.io/mdtoc -github.com/vburenin/ifacemaker diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd838924a0..6fde9db86b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -284,7 +284,7 @@ then head to the [main docs](https://eksctl.io/) for more information. This project is written in Go. To be able to contribute you will need: -1. A working Go installation of Go >= 1.12. You can check the +1. A working Go installation of Go >= 1.22. You can check the [official installation guide](https://golang.org/doc/install). 2. Make sure that `$(go env GOPATH)/bin` is in your shell's `PATH`. You can do so by @@ -344,19 +344,6 @@ To run the tests simply run the following after `install-build-deps`: make test ``` -If you prefer to use Docker, the same way it is used in CI, you can use the -following command: - -```bash -make -f Makefile.docker test -``` - -> NOTE: It is not the most convenient way of working on the project, as -> binaries are built inside the container and cannot be tested manually, -> also majority of end-users consume binaries and not Docker images. -> It is recommended to use `make build` etc, unless there is an issue in CI -> that need troubleshooting. - #### Running the integration tests > NOTE: Some parts of the integration tests are not configurable and therefore diff --git a/Dockerfile b/Dockerfile index 42ef4137b0..9f72347145 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ -ARG BUILD_IMAGE=public.ecr.aws/eksctl/eksctl-build:833f4464e865a6398788bf6cbc5447967b8974b7 -FROM $BUILD_IMAGE as build +# syntax=docker/dockerfile:1 +FROM public.ecr.aws/docker/library/golang:1.22.10 AS builder WORKDIR /src +COPY . . -COPY . /src +RUN --mount=type=cache,target=/go/pkg/mod <` for each of the hashes in the manifest to determine contents of each of the -# files used in `$(build_image_input)` at the time. -build_image_tag_file = build/docker/image_tag -build_image_tag = $(shell cat $(build_image_tag_file)) - -build_image = public.ecr.aws/eksctl/eksctl-build -build_image_name = $(build_image):$(build_image_tag) - -eksctl_image = public.ecr.aws/eksctl/eksctl -eksctl_image_name = "$(eksctl_image):$${EKSCTL_IMAGE_VERSION}" - -docker_build := time docker build -# We should eventually switch to buildkit, as it has a many feature and cleaner output with timing info, -# but right now 'docker build' doesn't allow us to export build cache images, so we cannot use it yet -# docker_build := env DOCKER_BUILDKIT=1 $(docker_build) - -sedi := -i -ifeq ($(shell uname), Darwin) -sedi = -i '' -endif - -##@ Docker -.PHONY: authenticate-ecr-for-docker -authenticate-ecr-for-docker: ## Get ECR public registry credentials with AWS credentials - aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws - -.PHONY: update-build-image-tag -update-build-image-tag: ## Update the build image tag as referenced across the repo - build-image-manifest.sh > $(image_manifest_file) - git hash-object $(image_manifest_file) > $(build_image_tag_file) - sed $(sedi) -e "1s|\(BUILD_IMAGE=\).*|\1$(build_image):$$(cat $(build_image_tag_file))|" Dockerfile - find .github/workflows -type f | xargs sed $(sedi) -e "s|\($(build_image):\).*|\1$$(cat $(build_image_tag_file))|" - -.PHONY: check-build-image-manifest-up-to-date -check-build-image-manifest-up-to-date: update-build-image-tag ## Update build image manifest and commits the changes - git diff --quiet -- $(image_manifest_file) \ - || (git --no-pager diff $(image_manifest_file); echo "HINT: to fix this, run 'make -f Makefile.docker update-build-image-tag' then 'commit-new-image-tag'"; exit 1) - -.PHONY: commit-new-image-tag -commit-new-image-tag: ## Update build image manifest and commits the changes - git add -u - git commit --message 'Update build image manifest, tag file and workflows' - @echo "Remember to run \"Publish ECR eksctl-build image\" GitHub workflow after merging these image tag changes" - -.PHONY: build-image -build-image: check-build-image-manifest-up-to-date ## Build the build image that has all of external dependencies - -docker pull $(build_image_name) - cp .requirements build/scripts/install-build-deps.sh go.mod go.sum build/docker/ - $(docker_build) \ - --cache-from=$(build_image_name) \ - --tag=$(build_image_name) \ - build/docker/ - -.PHONY: push-build-image -push-build-image: authenticate-ecr-for-docker build-image ## Push the build image to the ECR public registry - docker push $(build_image_name) - @echo "Remember to commit the image_tag and build_image_manifest files" - -.PHONY: eksctl-image -eksctl-image: ## Build the eksctl image that has release artefacts and no build dependencies - docker pull $(build_image_name) - $(docker_build) \ - --cache-from=$(build_image_name) \ - --tag=$(eksctl_image_name) \ - --build-arg=BUILD_IMAGE=$(build_image_name) \ - $(git_toplevel) - -.PHONY: eksctl-image -push-eksctl-image: eksctl-image ## Push the eksctl image to the ECR public registry - docker push $(eksctl_image_name) - -.PHONY: build-test -build-test: ## Run targets from Makefile using the build image - time docker run \ - --tty \ - --rm \ - --volume=$(git_toplevel):/src \ - $(build_image_name) make $@ diff --git a/build/build_image_manifest b/build/build_image_manifest deleted file mode 100644 index 536359212e..0000000000 --- a/build/build_image_manifest +++ /dev/null @@ -1,4 +0,0 @@ -100644 blob 61341ff136c0f62b5bbc2fc45e88b0c5d7697560 Dockerfile -100644 blob 51696980d08fa54ab5c95851fd612daf32b51d55 go.mod -100644 blob 549aa97c8159148a0e313e2bd951dc6197bd7659 go.sum -100755 blob 22ded60f9a8dab8cc97c40943c113a0360859273 install-build-deps.sh diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile deleted file mode 100644 index d3ad8df01a..0000000000 --- a/build/docker/Dockerfile +++ /dev/null @@ -1,56 +0,0 @@ -# Make sure to run the following commands after changes to this file are made: -# `make -f Makefile.docker update-build-image-tag && make -f Makefile.docker push-build-image` - -FROM golang:1.21.7-alpine3.19@sha256:163801a964d358d6450aeb51b59d5c807d43a7c97fed92cc7ff1be5bd72811ab AS base - -# Add kubectl and aws-iam-authenticator to the PATH -ENV PATH="${PATH}:/out/usr/bin:/out/usr/local/bin" - -# Build-time dependencies -RUN apk add --no-cache \ - bash \ - curl \ - docker-cli \ - g++ \ - gcc \ - git \ - httpie \ - libsass-dev \ - make \ - musl-dev \ - jq \ - py3-setuptools \ - tar \ - && true - -# Runtime dependencies. Build the root filesystem of the eksctl image at /out -RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ -RUN apk add --no-cache --initdb --root /out \ - alpine-baselayout \ - busybox \ - ca-certificates \ - coreutils \ - git \ - libc6-compat \ - openssh \ - && true - -RUN curl --silent --location "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" --output /out/usr/local/bin/kubectl \ - && chmod +x /out/usr/local/bin/kubectl - -ENV GITHUB_CLI_VERSION 1.14.0 -RUN curl --silent --location "https://github.com/cli/cli/releases/download/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_amd64.tar.gz" \ - | tar xvz -C /out/usr/local/bin --strip-components=2 gh_${GITHUB_CLI_VERSION}_linux_amd64/bin/gh && gh --version - -# Remaining dependencies are controlled by go.mod -WORKDIR /src -ENV CGO_ENABLED=0 GOPROXY=https://proxy.golang.org,direct - -# The authenticator is a runtime dependency, so it needs to be in /out -ENV AWS_IAM_AUTH_VERSION 0.5.7 -RUN curl --silent --location "https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_IAM_AUTH_VERSION}/aws-iam-authenticator_${AWS_IAM_AUTH_VERSION}_linux_amd64" --output /out/usr/local/bin/aws-iam-authenticator \ - && chmod +x /out/usr/local/bin/aws-iam-authenticator -COPY .requirements install-build-deps.sh go.mod go.sum /src/ - -# Install all build tools dependencies -RUN ./install-build-deps.sh diff --git a/build/docker/build_image_manifest b/build/docker/build_image_manifest deleted file mode 100644 index 833f4464e8..0000000000 --- a/build/docker/build_image_manifest +++ /dev/null @@ -1,18 +0,0 @@ -"github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1" -"github.com/cloudflare/cfssl v1.6.4" -"github.com/cloudflare/cfssl v1.6.4" -"github.com/golangci/golangci-lint v1.57.2" -"github.com/onsi/ginkgo/v2 v2.17.1" -"github.com/vektra/mockery/v2 v2.38.0" -"github.com/github-release/github-release v0.10.0" -"golang.org/x/tools v0.20.0" -"k8s.io/code-generator v0.29.0" -"k8s.io/code-generator v0.29.0" -"k8s.io/code-generator v0.29.0" -"k8s.io/code-generator v0.29.0" -"k8s.io/code-generator v0.29.0" -"sigs.k8s.io/mdtoc v1.1.0" -"github.com/vburenin/ifacemaker v1.2.1" -100644 blob d3ad8df01a6d4b3470b73aa0b7b4d1e2393ac1a6 build/docker/Dockerfile -100644 blob 06375e647bf25352987c7d3105252076c8292e4c .requirements -100755 blob c1129ff1ff85ac2c53f908a577675ea59a9325a7 build/scripts/install-build-deps.sh diff --git a/build/docker/image_tag b/build/docker/image_tag deleted file mode 100644 index 6bf2117a55..0000000000 --- a/build/docker/image_tag +++ /dev/null @@ -1 +0,0 @@ -833f4464e865a6398788bf6cbc5447967b8974b7 diff --git a/build/scripts/build-image-manifest.sh b/build/scripts/build-image-manifest.sh deleted file mode 100755 index 25fc64f166..0000000000 --- a/build/scripts/build-image-manifest.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -eu - -REQUIREMENTS_FILE=.requirements - -if [ ! -f "$REQUIREMENTS_FILE" ] -then - echo "Requirements file $REQUIREMENTS_FILE not found. Exiting..." - exit 1 -fi - -# Versions of build tools. One in each line " " -while IFS= read -r req; do - # remove the @ as go list is not module aware unless using -m but then it - # tries the local module in which we don't import it. - req=${req%@*} - go list -json "${req}" | jq '.Module| "\(.Path) \(.Version)"' -done < ${REQUIREMENTS_FILE} - -git ls-tree --full-tree @ -- build/docker/Dockerfile -git ls-tree --full-tree @ -- .requirements -git ls-tree --full-tree @ -- build/scripts/install-build-deps.sh diff --git a/build/scripts/install-build-deps.sh b/build/scripts/install-build-deps.sh deleted file mode 100755 index c1129ff1ff..0000000000 --- a/build/scripts/install-build-deps.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -eux - -# Make sure to run the following commands after changes to this file are made: -# `make -f Makefile.docker check-build-image-manifest-up-to-date && make -f Makefile.docker push-build-image` - -if [ -z "${GOBIN+x}" ]; then - GOBIN="${GOPATH%%:*}/bin" -fi - -if [ "$(uname)" = "Darwin" ] ; then - OSARCH="darwin-amd64" -else - OSARCH="linux-amd64" -fi - -REQUIREMENTS_FILE=.requirements - -if [ ! -f "$REQUIREMENTS_FILE" ] -then - echo "Requirements file $REQUIREMENTS_FILE not found. Exiting..." - exit 1 -fi - -# Install all other Go build requirements -while IFS= read -r req; do - GO111MODULE=on go install "${req}" -done < ${REQUIREMENTS_FILE} diff --git a/go.mod b/go.mod index 984266e1a8..101da7df19 100644 --- a/go.mod +++ b/go.mod @@ -3,30 +3,30 @@ // you may also need to run `make push-build-image` depending on what has changed module github.com/weaveworks/eksctl -go 1.21 +go 1.22 -toolchain go1.21.5 +toolchain go1.22.10 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/aws/amazon-ec2-instance-selector/v2 v2.4.2-0.20230601180523-74e721cb8c1e github.com/aws/aws-sdk-go v1.51.16 - github.com/aws/aws-sdk-go-v2 v1.32.6 + github.com/aws/aws-sdk-go-v2 v1.32.8 github.com/aws/aws-sdk-go-v2/config v1.27.11 github.com/aws/aws-sdk-go-v2/credentials v1.17.11 - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.1 - github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.1 - github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.3 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.0 + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.4 + github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.4 + github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.6 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.3 github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3 github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0 - github.com/aws/aws-sdk-go-v2/service/eks v1.53.0 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.6 - github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.1 - github.com/aws/aws-sdk-go-v2/service/iam v1.38.2 + github.com/aws/aws-sdk-go-v2/service/eks v1.56.2 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.9 + github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.4 + github.com/aws/aws-sdk-go-v2/service/iam v1.38.4 github.com/aws/aws-sdk-go-v2/service/kms v1.27.5 - github.com/aws/aws-sdk-go-v2/service/outposts v1.47.2 - github.com/aws/aws-sdk-go-v2/service/ssm v1.56.1 + github.com/aws/aws-sdk-go-v2/service/outposts v1.48.1 + github.com/aws/aws-sdk-go-v2/service/ssm v1.56.4 github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 github.com/aws/smithy-go v1.22.1 github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240508073157-fbfa1bc129f5 @@ -127,8 +127,8 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.27 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.27 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 // indirect diff --git a/go.sum b/go.sum index e77165d7e5..f3460bc3fd 100644 --- a/go.sum +++ b/go.sum @@ -718,6 +718,8 @@ github.com/aws/aws-sdk-go v1.51.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3Tj github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2 v1.32.8 h1:cZV+NUS/eGxKXMtmyhtYPJ7Z4YLoI/V8bkTdRZfYhGo= +github.com/aws/aws-sdk-go-v2 v1.32.8/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA= @@ -729,33 +731,51 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24L github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.27 h1:jSJjSBzw8VDIbWv+mmvBSP8ezsztMYJGH+eKqi9AmNs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.27/go.mod h1:/DAhLbFRgwhmvJdOfSm+WwikZrCuUJiA4WgJG0fTNSw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.27 h1:l+X4K77Dui85pIj5foXDhPlnqcNRG2QUyvca300lXh8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.27/go.mod h1:KvZXSFEXm6x84yE8qffKvT3x8J5clWnVFXphpohhzJ8= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.1 h1:XFZsqNpwwi/D8nFI/tdUQn1QW1BTVcuQH382RNUXojE= github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.1/go.mod h1:r+eOyjSMo2zY+j6zEEaHjb7nU74oyva1r2/wFqDkPg4= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.4 h1:w4Tdy9sQlJdcF5dZ9H5uRxradA9Mi2Hp4eOHQmxUJhA= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.51.4/go.mod h1:6klY3glv/b/phmA0CUj38SWNBior8rKtVvAJrAXljis= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.1 h1:EqRhsrEoXFFyzcNuqQCF1g9rG9EA8K2EiUj6/eWClgk= github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.1/go.mod h1:75rrfzgrN4Ol0m9Xo4+8S09KBoGAd1t6eafFHMt5wDI= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.2 h1:DrN2vg75JseLCepYjMVav43e+v7+AhArtWlm2F0OJ6Y= -github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.2/go.mod h1:WcTfALKgqv+VCMRCLtG4155sAwcfdYhFADc/yDJgSlc= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.4 h1:uH6So7Ee+2JQf+TKbfifXKUDNN0JfaJ6CgJ6Bh/u1sc= +github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.4/go.mod h1:GdDLBO8SzD4wvQ6fhqU1QCmvG1waj1MPHL4cBtuSgdQ= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.3 h1:DfrEQMWCfk0wkuv/r0zwcGoykCuYWCLoGolbax6O3sw= github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.3/go.mod h1:WcTfALKgqv+VCMRCLtG4155sAwcfdYhFADc/yDJgSlc= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.6 h1:fMIPTKNUEtU0JCBtKEDH0mvhyDBYZ6dEgqpBOYB5hOU= +github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.6/go.mod h1:a2KI7mJ3kF1AdkW4Cyu0fl/6G9H+x7J7KD7BZdvLwYg= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.0 h1:j9rGKWaYglZpf9KbJCQVM/L85Y4UdGMgK80A1OddR24= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.0/go.mod h1:LZafBHU62ByizrdhNLMnzWGsUX+abAW4q35PN+FOj+A= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.3 h1:va7zt8/kkg5zR0TX2r7wCXssdZ4+blRxbsA6IS9XXYI= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.45.3/go.mod h1:CijDCaRp5sH8QM0LqImyzy5roG8cOtgp2Abj0V/4luk= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3 h1:JNWpkjImTP2e308bv7ihfwgOawf640BY/pyZWrBb9rw= github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.36.3/go.mod h1:TiLZ2/+WAEyG2PnuAYj/un46UJ7qBf5BWWTAKgaHP8I= github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0 h1:FDZVMxzXB13cRmHs3t3tH9gme8GhvmjsQXeXFI37OHU= github.com/aws/aws-sdk-go-v2/service/ec2 v1.166.0/go.mod h1:Wv7N3iFOKVsZNIaw9MOBUmwCkX6VMmQQRFhMrHtNGno= github.com/aws/aws-sdk-go-v2/service/eks v1.53.0 h1:ACTxnLwL6YNmuYbxtp/VR3HGL9SWXU6VZkXPjWST9ZQ= github.com/aws/aws-sdk-go-v2/service/eks v1.53.0/go.mod h1:ZzOjZXGGUQxOq+T3xmfPLKCZe4OaB5vm1LdGaC8IPn4= +github.com/aws/aws-sdk-go-v2/service/eks v1.56.2 h1:NXxglcZhHubtK2SgqavDGkbArM4NYI7QvLr+FpOL3Oo= +github.com/aws/aws-sdk-go-v2/service/eks v1.56.2/go.mod h1:KkH+D6VJmtIVGD9KTxB9yZu4hQP7s9kxWn8lLb7tmVg= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.6 h1:uQFPQNvc9hIaF7SyHQyg2vRtTcWONaa1LUUy+8LEzT8= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.6/go.mod h1:KkaWcwL6GJtS/TNn1+fVJPAR+6G7Bs7kEm8E3MlgbhQ= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.9 h1:phUmuRbBmJKpPBbGx34uZJuV1PPg4u0/RMzIecVVR0E= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.28.9/go.mod h1:EH2+vt500M2IewoiYVo4rP0gfRhIXzh6BDFZ5KbidUI= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.1 h1:L9Wt9zgtoYKIlaeFTy+EztGjL4oaXBBGtVXA+jaeYko= github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.1/go.mod h1:yxzLdxt7bVGvIOPYIKFtiaJCJnx2ChlIIvlhW4QgI6M= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.4 h1:tC9S2BkqlMWP3N2t4UasxIhIJSNY5g7EINjz94VK+3U= +github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.43.4/go.mod h1:OhWF5Dd6Ge4VW/RcFQKOO0eEv1JInQJoo6/tkCjlvrM= github.com/aws/aws-sdk-go-v2/service/iam v1.38.2 h1:8iFKuRj/FJipy/aDZ2lbq0DYuEHdrxp0qVsdi+ZEwnE= github.com/aws/aws-sdk-go-v2/service/iam v1.38.2/go.mod h1:UBe4z0VZnbXGp6xaCW1ulE9pndjfpsnrU206rWZcR0Y= +github.com/aws/aws-sdk-go-v2/service/iam v1.38.4 h1:440YtmP8Cn6Qp7WHYfvz2/Xzmu1v1Vox/FJnzUDDQGM= +github.com/aws/aws-sdk-go-v2/service/iam v1.38.4/go.mod h1:oXqc4hmGhZpj06Zu8z+ahXhdbjq4Uw8pjN9flty0Ync= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.14 h1:zSDPny/pVnkqABXYRicYuPf9z2bTqfH13HT3v6UheIk= @@ -764,10 +784,14 @@ github.com/aws/aws-sdk-go-v2/service/kms v1.27.5 h1:7lKTr8zJ2nVaVgyII+7hUayTi7xW github.com/aws/aws-sdk-go-v2/service/kms v1.27.5/go.mod h1:D9FVDkZjkZnnFHymJ3fPVz0zOUlNSd0xcIIVmmrAac8= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.2 h1:OpS3l/leIv8pbK1zaeoZ5WzzTojbLN8zdK8inc37bMM= github.com/aws/aws-sdk-go-v2/service/outposts v1.47.2/go.mod h1:5X4a801ISjSwj+2Wq5FVicytit172Cdy7Clwia8l3Q0= +github.com/aws/aws-sdk-go-v2/service/outposts v1.48.1 h1:UpEOfSzEsykGrXBc90elNcE6eGX//z0n4W4+gaxE8Bs= +github.com/aws/aws-sdk-go-v2/service/outposts v1.48.1/go.mod h1:g0Txg8E+JL0CZT5l5kYqQQLBcwYu2SWPs8Tkzi6lMuk= github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 h1:RQOMvPwte2H4ZqsiZmrla1crhBWDFnW8bZynkec5cGU= github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0/go.mod h1:LJyh9figH3ZpSiVjR5umzbl6V3EpQdZR4Se1ayoUtfI= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.1 h1:cfVjoEwOMOJOI6VoRQua0nI0KjZV9EAnR8bKaMeSppE= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.1/go.mod h1:fGHwAnTdNrLKhgl+UEeq9uEL4n3Ng4MJucA+7Xi3sC4= +github.com/aws/aws-sdk-go-v2/service/ssm v1.56.4 h1:oXh/PjaKtStu7RkaUtuKX6+h/OxXriMa9WyQQhylKG0= +github.com/aws/aws-sdk-go-v2/service/ssm v1.56.4/go.mod h1:IiHGbiFg4wVdEKrvFi/zxVZbjfEpgSe21N9RwyQFXCU= github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w= github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE= diff --git a/pkg/awsapi/eks.go b/pkg/awsapi/eks.go index 6b3659b09f..c4752e5b79 100644 --- a/pkg/awsapi/eks.go +++ b/pkg/awsapi/eks.go @@ -261,6 +261,8 @@ type EKS interface { // // [Creating or updating a kubeconfig file for an Amazon EKS cluster]: https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html DescribeCluster(ctx context.Context, params *DescribeClusterInput, optFns ...func(*Options)) (*DescribeClusterOutput, error) + // Lists available Kubernetes versions for Amazon EKS clusters. + DescribeClusterVersions(ctx context.Context, params *DescribeClusterVersionsInput, optFns ...func(*Options)) (*DescribeClusterVersionsOutput, error) // Returns descriptive information about a subscription. DescribeEksAnywhereSubscription(ctx context.Context, params *DescribeEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DescribeEksAnywhereSubscriptionOutput, error) // Describes an Fargate profile. diff --git a/pkg/awsapi/outposts.go b/pkg/awsapi/outposts.go index 10ed223251..7222906803 100644 --- a/pkg/awsapi/outposts.go +++ b/pkg/awsapi/outposts.go @@ -109,8 +109,8 @@ type Outposts interface { ListSites(ctx context.Context, params *ListSitesInput, optFns ...func(*Options)) (*ListSitesOutput, error) // Lists the tags for the specified resource. ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) - // Starts the specified capacity task. You can have one active capacity task per - // order or Outpost. + // Starts the specified capacity task. You can have one active capacity task for + // each order and each Outpost. StartCapacityTask(ctx context.Context, params *StartCapacityTaskInput, optFns ...func(*Options)) (*StartCapacityTaskOutput, error) // Amazon Web Services uses this action to install Outpost servers. // diff --git a/pkg/eks/mocksv2/EKS.go b/pkg/eks/mocksv2/EKS.go index 2c4883f301..804d09173e 100644 --- a/pkg/eks/mocksv2/EKS.go +++ b/pkg/eks/mocksv2/EKS.go @@ -1724,6 +1724,80 @@ func (_c *EKS_DescribeCluster_Call) RunAndReturn(run func(context.Context, *eks. return _c } +// DescribeClusterVersions provides a mock function with given fields: ctx, params, optFns +func (_m *EKS) DescribeClusterVersions(ctx context.Context, params *eks.DescribeClusterVersionsInput, optFns ...func(*eks.Options)) (*eks.DescribeClusterVersionsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeClusterVersions") + } + + var r0 *eks.DescribeClusterVersionsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *eks.DescribeClusterVersionsInput, ...func(*eks.Options)) (*eks.DescribeClusterVersionsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *eks.DescribeClusterVersionsInput, ...func(*eks.Options)) *eks.DescribeClusterVersionsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*eks.DescribeClusterVersionsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *eks.DescribeClusterVersionsInput, ...func(*eks.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EKS_DescribeClusterVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeClusterVersions' +type EKS_DescribeClusterVersions_Call struct { + *mock.Call +} + +// DescribeClusterVersions is a helper method to define mock.On call +// - ctx context.Context +// - params *eks.DescribeClusterVersionsInput +// - optFns ...func(*eks.Options) +func (_e *EKS_Expecter) DescribeClusterVersions(ctx interface{}, params interface{}, optFns ...interface{}) *EKS_DescribeClusterVersions_Call { + return &EKS_DescribeClusterVersions_Call{Call: _e.mock.On("DescribeClusterVersions", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *EKS_DescribeClusterVersions_Call) Run(run func(ctx context.Context, params *eks.DescribeClusterVersionsInput, optFns ...func(*eks.Options))) *EKS_DescribeClusterVersions_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*eks.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*eks.Options)) + } + } + run(args[0].(context.Context), args[1].(*eks.DescribeClusterVersionsInput), variadicArgs...) + }) + return _c +} + +func (_c *EKS_DescribeClusterVersions_Call) Return(_a0 *eks.DescribeClusterVersionsOutput, _a1 error) *EKS_DescribeClusterVersions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EKS_DescribeClusterVersions_Call) RunAndReturn(run func(context.Context, *eks.DescribeClusterVersionsInput, ...func(*eks.Options)) (*eks.DescribeClusterVersionsOutput, error)) *EKS_DescribeClusterVersions_Call { + _c.Call.Return(run) + return _c +} + // DescribeEksAnywhereSubscription provides a mock function with given fields: ctx, params, optFns func (_m *EKS) DescribeEksAnywhereSubscription(ctx context.Context, params *eks.DescribeEksAnywhereSubscriptionInput, optFns ...func(*eks.Options)) (*eks.DescribeEksAnywhereSubscriptionOutput, error) { _va := make([]interface{}, len(optFns))