Skip to content

Commit 5c8b046

Browse files
authored
Revert dependencies changes that are making release workflow fail (#8157)
* Revert "Bump github.com/gofrs/flock from 0.8.1 to 0.12.1 (#8024)" This reverts commit 18394bd. * Revert "Bump github.com/github-release/github-release from 0.10.0 to 0.10.1 (#8107)" This reverts commit 34ab1f8. * Revert "Migrate `goformation` under `pkg/` as a local package and remove location re-write (#8153)" This reverts commit d0e5360. * Revert "Upgrade to go 1.22 (#8125)" This reverts commit ccdd44c.
1 parent d1e6319 commit 5c8b046

File tree

4,019 files changed

+8462
-7945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,019 files changed

+8462
-7945
lines changed

.dockerignore

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.editorconfig
2-
.dockerignore
3-
.github
4-
.gitignore
5-
*.md
6-
*.toml
7-
docs
8-
eksctl
9-
examples
10-
logo
11-
userdocs
12-
CNAME
13-
DCO
14-
LICENSE
1+
*
2+
!.git
3+
!.goreleaser*
4+
!.golangci*
5+
!.mockery.yaml
6+
!build/scripts
7+
!cmd
8+
!examples
9+
!go.*
10+
!integration
11+
!LICENSE
12+
!Makefile*
13+
!pkg
14+
!tools.go

.github/actions/setup-build/action.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
- name: Setup Go
99
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5.0.0
1010
with:
11-
go-version: 1.22.x
11+
go-version: 1.21.x
1212
cache: false
1313
- name: Cache go-build and mod
1414
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 #v4.0.0
@@ -19,3 +19,7 @@ runs:
1919
key: go-${{ hashFiles('go.sum') }}
2020
restore-keys: |
2121
go-
22+
- name: Setup deps
23+
shell: bash
24+
run: |
25+
make install-build-deps
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build all distros
2+
on:
3+
schedule:
4+
- cron: '0 9 * * 1-5'
5+
workflow_dispatch: {}
6+
7+
jobs:
8+
build-all-distros:
9+
name: build all distros
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clean unncessary files to save space
13+
run: |
14+
docker rmi `docker images -q`
15+
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d
16+
sudo apt -y autoremove --purge
17+
sudo apt -y autoclean
18+
sudo apt clean
19+
rm --recursive --force "$AGENT_TOOLSDIRECTORY"
20+
df -h
21+
- name: Free Disk Space (Ubuntu)
22+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be #v1.3.1
23+
with:
24+
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
25+
tool-cache: false
26+
large-packages: true
27+
swap-storage: true
28+
29+
- name: Checkout
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
31+
with:
32+
fetch-depth: 0
33+
- name: Setup build environment
34+
uses: ./.github/actions/setup-build
35+
36+
- name: Build image
37+
run: |
38+
EKSCTL_IMAGE_VERSION=${GITHUB_REF#refs/*/} make -f Makefile.docker eksctl-image
39+
40+
- name: Generate artifacts
41+
run: |
42+
make generate-always
43+
- name: Run GoReleaser
44+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf #v6.1.0
45+
with:
46+
version: v1.24.0
47+
args: --config=.github/.goreleaser-local.yaml --snapshot --skip=publish --clean
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Cache Dependencies
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
cache-dependencies:
9+
name: Cache dependencies
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Cache Go modules
13+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0
14+
with:
15+
path: |
16+
~/.cache/go-build/
17+
~/go/pkg/mod/
18+
key: go-${{ hashFiles('go.sum') }}
19+
restore-keys: |
20+
go-
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish ECR eksctl-build image
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
id-token: write
7+
contents: read
8+
9+
jobs:
10+
build-and-push-to-registry:
11+
name: Build and push container image
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup build environment
20+
uses: ./.github/actions/setup-build
21+
22+
- name: Configure AWS credentials
23+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
24+
with:
25+
aws-region: us-east-1
26+
role-duration-seconds: 7200
27+
role-session-name: eksctl-build-ecr-publisher
28+
role-to-assume: ${{ secrets.ECR_PUBLISH_ROLE_ARN }}
29+
30+
- name: Login to Amazon ECR Public
31+
id: login-ecr-public
32+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v1
33+
with:
34+
registry-type: public
35+
36+
- name: Build and push image
37+
run: |
38+
PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker push-build-image

.github/workflows/ecr-publish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
context: .
4747
push: true
4848
tags: ${{ steps.meta.outputs.tags }}
49-
labels: ${{ steps.meta.outputs.labels }}
49+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/link-checker.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Go
2222
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0
2323
with:
24-
go-version: 1.22.x
24+
go-version: 1.21.x
2525
cache: false
2626

2727
- name: Install doc dependencies
@@ -33,4 +33,4 @@ jobs:
3333
- name: Link Checker
3434
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 #v2.2.0
3535
with:
36-
args: --exclude-all-private --exclude-mail --exclude-file .github/workflows/exclude-file.txt --exclude-path pkg/goformation --verbose --no-progress './**/*.md' './**/*.html'
36+
args: --exclude-all-private --exclude-mail --exclude-file .github/workflows/exclude-file.txt --exclude-path goformation --verbose --no-progress './**/*.md' './**/*.html'

.github/workflows/test-and-build.yaml

+5-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
- name: Lint
3333
run: |
3434
PATH=$PATH:$(go env GOPATH)/bin make lint
35-
3635
image:
3736
name: Build and check image
3837
runs-on: ubuntu-latest
@@ -41,10 +40,8 @@ jobs:
4140
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
4241
with:
4342
fetch-depth: 0
44-
- name: Build image
45-
id: push
46-
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc #v6.11.0
47-
with:
48-
context: .
49-
file: ./Dockerfile
50-
push: false
43+
- name: Setup build environment
44+
uses: ./.github/actions/setup-build
45+
- name: build
46+
run: |
47+
PATH=$PATH:$(go env GOPATH)/bin make -f Makefile.docker check-build-image-manifest-up-to-date

.golangci.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# options for analysis running
22
run:
3-
go: "1.22"
3+
go: "1.21"
44

55
# default concurrency is a available CPU number
66
concurrency: 4
@@ -19,7 +19,34 @@ run:
1919
- release
2020
- integration
2121

22+
# output configuration options
2223
output:
24+
# The formats used to render issues.
25+
# Formats:
26+
# - `colored-line-number`
27+
# - `line-number`
28+
# - `json`
29+
# - `colored-tab`
30+
# - `tab`
31+
# - `html`
32+
# - `checkstyle`
33+
# - `code-climate`
34+
# - `junit-xml`
35+
# - `junit-xml-extended`
36+
# - `github-actions`
37+
# - `teamcity`
38+
# - `sarif`
39+
# Output path can be either `stdout`, `stderr` or path to the file to write to.
40+
#
41+
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
42+
# The output can be specified for each of them by separating format name and path by colon symbol.
43+
# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number"
44+
# The CLI flag (`--out-format`) override the configuration file.
45+
#
46+
# Default:
47+
# formats:
48+
# - format: colored-line-number
49+
# path: stdout
2350
formats:
2451
- format: tab
2552

@@ -154,7 +181,7 @@ issues:
154181
- ^vendor$
155182
- ^build$
156183
- ^pkg\/eks\/mocks$
157-
- ^pkg\/goformation*
184+
- ^goformation$
158185

159186
# Which files to exclude: they will be analyzed, but issues from them won't be reported.
160187
# There is no need to include all autogenerated files,

.requirements

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
github.com/maxbrunsfeld/counterfeiter/v6
2+
github.com/cloudflare/cfssl/cmd/[email protected]
3+
github.com/cloudflare/cfssl/cmd/[email protected]
4+
github.com/golangci/golangci-lint/cmd/golangci-lint
5+
github.com/onsi/ginkgo/v2/[email protected]
6+
github.com/vektra/mockery/v2
7+
github.com/github-release/github-release
8+
golang.org/x/tools/cmd/stringer
9+
k8s.io/code-generator/cmd/client-gen
10+
k8s.io/code-generator/cmd/deepcopy-gen
11+
k8s.io/code-generator/cmd/defaulter-gen
12+
k8s.io/code-generator/cmd/informer-gen
13+
k8s.io/code-generator/cmd/lister-gen
14+
sigs.k8s.io/mdtoc
15+
github.com/vburenin/ifacemaker

CONTRIBUTING.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ then head to the [main docs](https://eksctl.io/) for more information.
284284

285285
This project is written in Go. To be able to contribute you will need:
286286

287-
1. A working Go installation of Go >= 1.22. You can check the
287+
1. A working Go installation of Go >= 1.12. You can check the
288288
[official installation guide](https://golang.org/doc/install).
289289

290290
2. Make sure that `$(go env GOPATH)/bin` is in your shell's `PATH`. You can do so by
@@ -344,6 +344,19 @@ To run the tests simply run the following after `install-build-deps`:
344344
make test
345345
```
346346

347+
If you prefer to use Docker, the same way it is used in CI, you can use the
348+
following command:
349+
350+
```bash
351+
make -f Makefile.docker test
352+
```
353+
354+
> NOTE: It is not the most convenient way of working on the project, as
355+
> binaries are built inside the container and cannot be tested manually,
356+
> also majority of end-users consume binaries and not Docker images.
357+
> It is recommended to use `make build` etc, unless there is an issue in CI
358+
> that need troubleshooting.
359+
347360
#### Running the integration tests
348361

349362
> NOTE: Some parts of the integration tests are not configurable and therefore

Dockerfile

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# syntax=docker/dockerfile:1
2-
FROM public.ecr.aws/docker/library/golang:1.22.10 AS builder
1+
ARG BUILD_IMAGE=public.ecr.aws/eksctl/eksctl-build:833f4464e865a6398788bf6cbc5447967b8974b7
2+
FROM $BUILD_IMAGE as build
33

44
WORKDIR /src
5-
COPY . .
65

7-
RUN --mount=type=cache,target=/go/pkg/mod <<EOT
8-
go mod download
9-
EOT
6+
COPY . /src
107

11-
RUN <<EOT
12-
make build
13-
chown 65532 eksctl
14-
EOT
8+
RUN make test
9+
RUN make build \
10+
&& cp ./eksctl /out/usr/local/bin/eksctl
11+
RUN make build-integration-test \
12+
&& mkdir -p /out/usr/local/share/eksctl \
13+
&& cp -r integration/data/*.yaml integration/scripts /out/usr/local/share/eksctl \
14+
&& cp ./eksctl-integration-test /out/usr/local/bin/eksctl-integration-test
1515

16-
FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.16.4-eks-1-31-11 AS go-runner
17-
COPY --from=builder /src/eksctl /eksctl
18-
ENTRYPOINT ["/eksctl"]
16+
FROM scratch
17+
COPY --from=build /out /
18+
ENTRYPOINT ["eksctl"]

0 commit comments

Comments
 (0)