Skip to content

Commit

Permalink
Upgrade to go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Jan 10, 2025
1 parent 389f071 commit 26f8c29
Show file tree
Hide file tree
Showing 25 changed files with 163 additions and 420 deletions.
28 changes: 14 additions & 14 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions .github/actions/setup-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,7 +19,3 @@ runs:
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup deps
shell: bash
run: |
make install-build-deps
49 changes: 0 additions & 49 deletions .github/workflows/build-all-distros-nightly.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/cache-dependencies.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/ecr-publish-build.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ecr-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 8 additions & 5 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# options for analysis running
run:
go: "1.21"
go: "1.22"

# default concurrency is a available CPU number
concurrency: 4
Expand Down
15 changes: 0 additions & 15 deletions .requirements

This file was deleted.

15 changes: 1 addition & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <<EOT
go mod download
EOT

RUN make test
RUN make build \
&& cp ./eksctl /out/usr/local/bin/eksctl
RUN make build-integration-test \
&& mkdir -p /out/usr/local/share/eksctl \
&& cp -r integration/data/*.yaml integration/scripts /out/usr/local/share/eksctl \
&& cp ./eksctl-integration-test /out/usr/local/bin/eksctl-integration-test
RUN <<EOT
make build
chown 65532 eksctl
EOT

FROM scratch
COPY --from=build /out /
ENTRYPOINT ["eksctl"]
FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.16.4-eks-1-31-11 AS go-runner
COPY --from=builder /src/eksctl /eksctl
ENTRYPOINT ["/eksctl"]
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include Makefile.common
include Makefile.docs
include Makefile.docker

version_pkg := github.com/weaveworks/eksctl/pkg/version

Expand Down Expand Up @@ -33,11 +32,7 @@ endif

##@ Dependencies
.PHONY: install-all-deps
install-all-deps: install-build-deps install-site-deps ## Install all dependencies for building both binary and user docs)

.PHONY: install-build-deps
install-build-deps: ## Install dependencies (packages and tools)
build/scripts/install-build-deps.sh
install-all-deps: install-site-deps ## Install all dependencies for building both binary and user docs)

##@ Build

Expand Down Expand Up @@ -139,7 +134,10 @@ delete-integration-test-dev-cluster: build ## Delete the test cluster for use wh
##@ Code Generation

.PHONY: generate-always
generate-always: pkg/addons/default/assets/aws-node.yaml ## Generate code (required for every build)
generate-always: ## Generate code (required for every build)
go install github.com/maxbrunsfeld/counterfeiter/v6
go install github.com/vektra/mockery/v2
go install github.com/vburenin/ifacemaker
go generate ./pkg/apis/eksctl.io/v1alpha5/generate.go
go generate ./pkg/nodebootstrap
go generate ./pkg/addons
Expand Down Expand Up @@ -185,9 +183,6 @@ generate-kube-reserved: ## Update instance list with respective specs
@cd ./pkg/nodebootstrap/ && go run reserved_generate.go

##@ Release
# .PHONY: eksctl-image
# eksctl-image: ## Build the eksctl image that has release artefacts and no build dependencies
# $(MAKE) -f Makefile.docker $@

.PHONY: prepare-release
prepare-release: ## Create release
Expand Down
2 changes: 0 additions & 2 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ git_org := $(shell dirname $(full_repo_name))
eksctl_version := $(shell go run pkg/version/generate/release_generate.go print-version)

unique_tag = $(shell printf "%s-%s-%s" `git rev-parse @` $(build_image_tag) $(built_at))

eksctl_image_name ?= weaveworks/eksctl:latest
Loading

0 comments on commit 26f8c29

Please sign in to comment.