Skip to content

Commit bf1e05e

Browse files
committed
Merge branch 'main' into auth-config
2 parents 4fdb6c2 + 4b2f770 commit bf1e05e

File tree

457 files changed

+31476
-44826
lines changed

Some content is hidden

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

457 files changed

+31476
-44826
lines changed

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "CAPA Devcontainer + Devbox + VSCode",
3+
"image": "mcr.microsoft.com/devcontainers/base",
4+
"features": {
5+
"ghcr.io/dlouwers/devcontainer-features/devbox:1": {},
6+
"ghcr.io/devcontainers/features/docker-in-docker:2.12.0": {},
7+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1.2.0": {
8+
"version": "latest",
9+
"helm": "none",
10+
"minikube": "none"
11+
}
12+
},
13+
"postCreateCommand": "devbox install",
14+
"customizations": {
15+
"vscode": {
16+
"settings": {},
17+
"extensions": [
18+
"jetpack-io.devbox",
19+
"foxundermoon.shell-format",
20+
"golang.go",
21+
"ethan-reesor.vscode-go-test-adapter",
22+
"ms-kubernetes-tools.vscode-kubernetes-tools",
23+
"ms-kubernetes-tools.kubernetes-ide",
24+
"ms-azuretools.vscode-dockerr",
25+
"redhat.vscode-yaml"
26+
]
27+
}
28+
}
29+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ Fixes #
2828
**Special notes for your reviewer**:
2929

3030
**Checklist**:
31-
<!-- Put an "X" character inside the brackets of each completed task. Some may be optional depending on the PR in which case these can be deleted -->
31+
<!-- Put an "X" character inside the brackets of each completed task. Some may be optional depending on the PR in which case these can be deleted
32+
33+
Please add an icon to the title of this PR, the icon will be either ⚠️ (:warning:, major or breaking changes), ✨ (:sparkles:, feature additions), 🐛 (:bug:, patch and bugfixes), 📖 (:book:, documentation or proposals), or 🌱 (:seedling:, minor or other)
34+
-->
3235

3336
- [ ] squashed commits
3437
- [ ] includes documentation
35-
- [ ] includes [emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning)
38+
- [ ] includes emoji in title
3639
- [ ] adds unit tests
3740
- [ ] adds or updates e2e tests
3841

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ updates:
4545
- dependency-name: "google.golang.org/grpc"
4646
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
4747
# Bumping the kustomize API independently can break compatibility with client-go as they share k8s.io/kube-openapi as a dependency.
48-
- dependency-name: "sigs.k8s.io/kustomize/api"
48+
# Bumping kustomize itself has led to using Go versions newer than what's available in the image builder jobs, breaking our builds.
49+
- dependency-name: "sigs.k8s.io/kustomize/*"
4950
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
5051
# Ignore openshift ROSA pkgs as its upgraded manually.
5152
- dependency-name: "github.com/openshift*"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: build-and-publish-ami-with-vars
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image_builder_version:
7+
description: "Image builder version"
8+
required: true
9+
default: 'v0.1.38'
10+
target:
11+
description: "target os"
12+
required: true
13+
type: choice
14+
options:
15+
- ubuntu-2204
16+
- ubuntu-2404
17+
- flatcar
18+
packer_vars:
19+
description: "Packer vars (json)"
20+
type: string
21+
22+
permissions:
23+
id-token: write
24+
contents: read
25+
26+
jobs:
27+
buildandpublish:
28+
name: Build and publish CAPA AMIs
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: checkout code
32+
uses: actions/checkout@v4
33+
with:
34+
repository: kubernetes-sigs/image-builder
35+
ref: ${{ inputs.image_builder_version }}
36+
fetch-depth: 0
37+
- name: Create packer vars file
38+
if: inputs.packer_vars != ''
39+
env:
40+
PACKER_VARS: ${{ inputs.packer_vars }}
41+
run: |
42+
echo "$PACKER_VARS" | jq -r > ./images/capi/vars.json
43+
cat ./images/capi/vars.json
44+
- name: Configure AWS credentials
45+
uses: aws-actions/configure-aws-credentials@v4
46+
with:
47+
aws-region: us-east-2
48+
role-to-assume: arn:aws:iam::819546954734:role/gh-image-builder
49+
- name: Install deps
50+
run: make deps-ami
51+
working-directory: ./images/capi
52+
- name: Install Amazon EBS Plugin
53+
working-directory: ./images/capi
54+
run: ./.local/bin/packer plugins install github.com/hashicorp/amazon
55+
- name: Build AMI with vars
56+
if: inputs.packer_vars != ''
57+
working-directory: ./images/capi
58+
run: PACKER_VAR_FILES=vars.json make build-ami-${{ inputs.target }}
59+
- name: Build AMI without vars
60+
if: inputs.packer_vars == ''
61+
working-directory: ./images/capi
62+
run: make build-ami-${{ inputs.target }}
63+

.github/workflows/build-ami.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: build-and-publish-ami
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image_builder_version:
7+
description: "Image builder version"
8+
required: true
9+
default: 'v0.1.38'
10+
regions:
11+
description: 'Publication regions'
12+
required: true
13+
default: 'ap-south-1,eu-west-3,eu-west-2,eu-west-1,ap-northeast-2,ap-northeast-1,sa-east-1,ca-central-1,ap-southeast-1,ap-southeast-2,eu-central-1,us-east-1,us-east-2,us-west-1,us-west-2'
14+
k8s_semver:
15+
description: 'K8s Semver'
16+
required: true
17+
k8s_series:
18+
description: 'K8s Release Series (major.minor version)'
19+
required: true
20+
k8s_rpm_version:
21+
description: 'K8s rpm package version'
22+
required: true
23+
k8s_deb_version:
24+
description: 'K8s deb package version'
25+
required: true
26+
cni_semver:
27+
description: 'CNI Semver'
28+
required: true
29+
cni_deb_version:
30+
description: 'CNI deb package version'
31+
required: true
32+
crictl_version:
33+
description: 'Crictl version'
34+
required: true
35+
36+
permissions:
37+
id-token: write
38+
contents: read
39+
40+
jobs:
41+
buildandpublish:
42+
strategy:
43+
matrix:
44+
target: ['ubuntu-2204', 'ubuntu-2404', 'flatcar']
45+
max-parallel: 1
46+
fail-fast: false
47+
name: Build and publish CAPA AMIs
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: checkout code
51+
uses: actions/checkout@v4
52+
with:
53+
repository: kubernetes-sigs/image-builder
54+
ref: ${{ inputs.image_builder_version }}
55+
fetch-depth: 0
56+
- name: Configure AWS credentials
57+
uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
aws-region: us-east-2
60+
role-to-assume: arn:aws:iam::819546954734:role/gh-image-builder
61+
- name: Install deps
62+
run: make deps-ami
63+
working-directory: ./images/capi
64+
- name: Install Amazon EBS Plugin
65+
working-directory: ./images/capi
66+
run: ./.local/bin/packer plugins install github.com/hashicorp/amazon
67+
- name: Create Packer Args
68+
env:
69+
K8S_RPM_VERSION: ${{ inputs.k8s_rpm_version }}
70+
K8S_SEMVER: ${{ inputs.k8s_semver }}
71+
K8S_SERIES: ${{ inputs.k8s_series }}
72+
K8S_DEB_VERSION: ${{ inputs.k8s_deb_version }}
73+
CNI_SEMVER: ${{ inputs.cni_semver }}
74+
CNI_DEB_VERSION: ${{ inputs.cni_deb_version }}
75+
CRICTL_VERSION: ${{ inputs.crictl_version }}
76+
AMI_REGIONS: ${{ inputs.regions }}
77+
run: |
78+
cat > ./images/capi/vars.json << EOF
79+
{
80+
"kubernetes_rpm_version": "$K8S_RPM_VERSION",
81+
"kubernetes_semver": "$K8S_SEMVER",
82+
"kubernetes_series": "$K8S_SERIES",
83+
"kubernetes_deb_version": "$K8S_DEB_VERSION",
84+
"kubernetes_cni_semver": "$CNI_SEMVER",
85+
"kubernetes_cni_deb_version": "$CNI_DEB_VERSION",
86+
"crictl_version": "$CRICTL_VERSION",
87+
"ami_regions": "$AMI_REGIONS"
88+
}
89+
EOF
90+
- name: Show vars
91+
run: cat ./images/capi/vars.json
92+
- name: Build AMI
93+
working-directory: ./images/capi
94+
run: PACKER_VAR_FILES=vars.json make build-ami-${{ matrix.target }}
95+

.github/workflows/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Go 1.x
2626
uses: actions/setup-go@v5
2727
with:
28-
go-version: '1.22'
28+
go-version: '1.23'
2929
id: go
3030
- name: Check out code into the Go module directory
3131
uses: actions/[email protected]

.github/workflows/pr-gh-workflow-approve.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
repo: context.repo.repo,
3838
run_id: run.id
3939
});
40-
}
40+
}

.github/workflows/pr-golangci-lint.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ jobs:
1717
working-directory:
1818
- ""
1919
steps:
20-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
2121
- name: Calculate go version
2222
id: vars
2323
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
2424
- name: Set up Go
25-
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
25+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
2626
with:
2727
go-version: ${{ steps.vars.outputs.go_version }}
2828
- name: golangci-lint
29-
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # tag=v6.0.1
29+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # tag=v8.0.0
3030
with:
31-
version: v1.56.1
32-
args: --out-format=colored-line-number
31+
version: v2.1.0
3332
working-directory: ${{matrix.working-directory}}
33+
- name: Lint API
34+
run: make lint-api

.github/workflows/pr-verify.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ on:
44
pull_request_target:
55
types: [opened, edited, synchronize, reopened]
66

7-
permissions:
8-
checks: write
9-
107
jobs:
118
verify:
129
runs-on: ubuntu-latest
1310
name: verify PR contents
1411
steps:
15-
- name: Verifier action
16-
id: verifier
17-
uses: kubernetes-sigs/kubebuilder-release-tools@012269a88fa4c034a0acf1ba84c26b195c0dbab4 # tag=v0.4.3
18-
with:
19-
github_token: ${{ secrets.GITHUB_TOKEN }}
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
13+
14+
- name: Check if PR title is valid
15+
env:
16+
PR_TITLE: ${{ github.event.pull_request.title }}
17+
run: |
18+
./hack/verify-pr-title.sh "${PR_TITLE}"

.github/workflows/release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: '1.22'
23+
go-version: '1.23'
2424
- name: Set version info
2525
run: |
2626
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
27-
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
27+
# NB: this gets the closest tag cut from the same branch; for new minor tags, it will find the previous minor, not the previous patch release
28+
# (for example v2.7.0, not v2.7.3). For new patch releases, it should fetch the previous patch (e.g. 2.7.3, not v2.7.0)
29+
echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV
2830
echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV
2931
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV
3032
- name: Run release

0 commit comments

Comments
 (0)