Skip to content

Commit

Permalink
Revert dependencies changes that are making release workflow fail (#8157
Browse files Browse the repository at this point in the history
)

* 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.
  • Loading branch information
TiberiuGC authored Jan 22, 2025
1 parent d1e6319 commit 5c8b046
Show file tree
Hide file tree
Showing 4,019 changed files with 8,462 additions and 7,945 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
28 changes: 14 additions & 14 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.editorconfig
.dockerignore
.github
.gitignore
*.md
*.toml
docs
eksctl
examples
logo
userdocs
CNAME
DCO
LICENSE
*
!.git
!.goreleaser*
!.golangci*
!.mockery.yaml
!build/scripts
!cmd
!examples
!go.*
!integration
!LICENSE
!Makefile*
!pkg
!tools.go
6 changes: 5 additions & 1 deletion .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.22.x
go-version: 1.21.x
cache: false
- name: Cache go-build and mod
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 #v4.0.0
Expand All @@ -19,3 +19,7 @@ runs:
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup deps
shell: bash
run: |
make install-build-deps
49 changes: 49 additions & 0 deletions .github/workflows/build-all-distros-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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 }}
20 changes: 20 additions & 0 deletions .github/workflows/cache-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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-
38 changes: 38 additions & 0 deletions .github/workflows/ecr-publish-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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
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 }}
4 changes: 2 additions & 2 deletions .github/workflows/link-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0
with:
go-version: 1.22.x
go-version: 1.21.x
cache: false

- name: Install doc dependencies
Expand All @@ -33,4 +33,4 @@ jobs:
- name: Link Checker
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374 #v2.2.0
with:
args: --exclude-all-private --exclude-mail --exclude-file .github/workflows/exclude-file.txt --exclude-path pkg/goformation --verbose --no-progress './**/*.md' './**/*.html'
args: --exclude-all-private --exclude-mail --exclude-file .github/workflows/exclude-file.txt --exclude-path goformation --verbose --no-progress './**/*.md' './**/*.html'
13 changes: 5 additions & 8 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
- name: Lint
run: |
PATH=$PATH:$(go env GOPATH)/bin make lint
image:
name: Build and check image
runs-on: ubuntu-latest
Expand All @@ -41,10 +40,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
with:
fetch-depth: 0
- name: Build image
id: push
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc #v6.11.0
with:
context: .
file: ./Dockerfile
push: false
- 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
31 changes: 29 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# options for analysis running
run:
go: "1.22"
go: "1.21"

# default concurrency is a available CPU number
concurrency: 4
Expand All @@ -19,7 +19,34 @@ run:
- release
- integration

# output configuration options
output:
# The formats used to render issues.
# Formats:
# - `colored-line-number`
# - `line-number`
# - `json`
# - `colored-tab`
# - `tab`
# - `html`
# - `checkstyle`
# - `code-climate`
# - `junit-xml`
# - `junit-xml-extended`
# - `github-actions`
# - `teamcity`
# - `sarif`
# Output path can be either `stdout`, `stderr` or path to the file to write to.
#
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
# The output can be specified for each of them by separating format name and path by colon symbol.
# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number"
# The CLI flag (`--out-format`) override the configuration file.
#
# Default:
# formats:
# - format: colored-line-number
# path: stdout
formats:
- format: tab

Expand Down Expand Up @@ -154,7 +181,7 @@ issues:
- ^vendor$
- ^build$
- ^pkg\/eks\/mocks$
- ^pkg\/goformation*
- ^goformation$

# Which files to exclude: they will be analyzed, but issues from them won't be reported.
# There is no need to include all autogenerated files,
Expand Down
15 changes: 15 additions & 0 deletions .requirements
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/maxbrunsfeld/counterfeiter/v6
github.com/cloudflare/cfssl/cmd/[email protected]
github.com/cloudflare/cfssl/cmd/[email protected]
github.com/golangci/golangci-lint/cmd/golangci-lint
github.com/onsi/ginkgo/v2/[email protected]
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
15 changes: 14 additions & 1 deletion 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.22. You can check the
1. A working Go installation of Go >= 1.12. 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,6 +344,19 @@ 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 @@
# syntax=docker/dockerfile:1
FROM public.ecr.aws/docker/library/golang:1.22.10 AS builder
ARG BUILD_IMAGE=public.ecr.aws/eksctl/eksctl-build:833f4464e865a6398788bf6cbc5447967b8974b7
FROM $BUILD_IMAGE as build

WORKDIR /src
COPY . .

RUN --mount=type=cache,target=/go/pkg/mod <<EOT
go mod download
EOT
COPY . /src

RUN <<EOT
make build
chown 65532 eksctl
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

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"]
FROM scratch
COPY --from=build /out /
ENTRYPOINT ["eksctl"]
Loading

0 comments on commit 5c8b046

Please sign in to comment.