Skip to content

Commit 0fdc408

Browse files
committed
PANDARIA: Merge tag 'v0.9.4' into release/v0.9-ent
2 parents 38cf318 + 5b69b4f commit 0fdc408

18 files changed

Lines changed: 385 additions & 337 deletions

File tree

.github/renovate.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
],
1414
"prHourlyLimit": 2,
1515
"enabledManagers": [
16-
"droneci",
1716
"dockerfile",
1817
"github-actions",
1918
"helm-values",

.github/workflows/ci.yaml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,16 @@ jobs:
2727
build:
2828
name: CI
2929
strategy:
30-
fail-fast: false
3130
matrix:
32-
os:
33-
- org-cnrancher-runner-dind-x64
34-
- org-cnrancher-runner-dind-arm64
35-
runs-on: ${{ matrix.os }}
31+
arch:
32+
- amd64
33+
- arm64
34+
runs-on: ubuntu-latest
3635
steps:
3736
- name : Checkout repository
3837
# https://github.com/actions/checkout/releases/tag/v4.1.1
39-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
40-
41-
- name: Setup Go
42-
# https://github.com/actions/setup-go/releases/tag/v5.0.0
43-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
44-
with:
45-
go-version-file: 'go.mod'
46-
- name: Install golangci-lint
47-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
48-
with:
49-
version: v1.64.8
38+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
39+
5040

5141
- name: Set arch variable
5242
shell: bash
@@ -60,6 +50,12 @@ jobs:
6050
;;
6151
esac
6252
53+
- name: "Install make"
54+
shell: bash
55+
run: |
56+
sudo apt update
57+
sudo apt install -y make
58+
6359
- name: Install dependencies
6460
shell: bash
6561
run: |
@@ -77,18 +73,13 @@ jobs:
7773
tar cfz "${{ runner.temp }}/rancher.tgz" -C build/chart/rancher .
7874
popd
7975
76+
- name: Build, Test, and Package
77+
run: make ci
78+
8079
- name: install K3d
81-
run: ./.github/workflows/scripts/install-k3d.sh
82-
env:
83-
K3D_VERSION: latest
84-
85-
- name: "PANDARIA: install make"
8680
run: |
87-
sudo apt update
88-
sudo apt install -y build-essential
89-
90-
- name: ci
91-
run: make ci
81+
./.github/workflows/scripts/install-k3d.sh
82+
sudo mv ./bin/k3d /usr/local/bin/k3d
9283
9384
- name: setup cluster
9485
run: ./.github/workflows/scripts/setup-cluster.sh

.github/workflows/publish-head.yaml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- arm64
2222
steps:
2323
- name : Checkout repository
24-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
2525
- name: Setup Go
26-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
26+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
2727
with:
2828
go-version-file: 'go.mod'
2929
- name: Build and package
@@ -54,7 +54,7 @@ jobs:
5454
needs: build
5555
steps:
5656
- name : Checkout repository
57-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
57+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
5858
- name: Download the artifacts
5959
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
6060
with:
@@ -65,31 +65,46 @@ jobs:
6565
mkdir -p bin/
6666
cp -v dist/artifacts/webhook-linux-${{ matrix.arch }} bin/webhook
6767
chmod +x bin/webhook
68-
# PANDARIA
68+
6969
# - name: "Read vault secrets"
70-
# uses: rancher-eio/read-vault-secrets@main
70+
# uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3
7171
# with:
7272
# secrets: |
7373
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
7474
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
75+
7576
- name: Set up QEMU
76-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
77+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
7778
- name: Set up Docker Buildx
78-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
79+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
7980
- name: Log in to the Container registry
80-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
81+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
8182
with:
8283
registry: ${{ env.REGISTRY }}
8384
username: ${{ secrets.TCR_USERNAME }}
8485
password: ${{ secrets.TCR_TOKEN }}
86+
87+
- name: Set Version/Commit
88+
run: |
89+
source ./scripts/version
90+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
91+
echo "COMMIT=${COMMIT}" >> $GITHUB_ENV
92+
8593
- name: Build and push the webhook image
8694
id: build
87-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
95+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
8896
with:
8997
context: .
9098
file: ./package/Dockerfile
99+
secrets: |
100+
token=${{ secrets.RD_ONLY_GH_TOKEN }}
91101
platforms: "linux/${{ matrix.arch }}"
92102
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook,push-by-digest=true,name-canonical=true,push=true
103+
build-args: |
104+
VERSION=${{ env.VERSION }}
105+
COMMIT=${{ env.COMMIT }}
106+
GOPRIVATE=github.com/cnrancher
107+
93108
- name: Export digest
94109
run: |
95110
mkdir -p /tmp/digests
@@ -115,16 +130,16 @@ jobs:
115130
pattern: digests-*
116131
merge-multiple: true
117132
- name: Set up Docker Buildx
118-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
119-
# PANDARIA
133+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
120134
# - name: "Read vault secrets"
121-
# uses: rancher-eio/read-vault-secrets@main
135+
# uses: rancher-eio/read-vault-secrets@0da85151ad1f19ed7986c41587e45aac1ace74b6 # v3
122136
# with:
123137
# secrets: |
124138
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
125139
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
140+
126141
- name: Log in to the Container registry
127-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
142+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
128143
with:
129144
registry: ${{ env.REGISTRY }}
130145
username: ${{ secrets.TCR_USERNAME }}

.github/workflows/release.yaml

Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,9 @@ jobs:
2626
steps:
2727

2828
- name : Checkout repository
29-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30-
# https://github.com/actions/checkout/releases/tag/v4.1.1
29+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3130

32-
- name: Setup Go
33-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
34-
# https://github.com/actions/setup-go/releases/tag/v5.0.0
35-
with:
36-
go-version-file: 'go.mod'
37-
38-
- name: Build and package
31+
- name: Build Binary
3932
run: |
4033
./scripts/build
4134
mkdir -p dist/artifacts
@@ -44,9 +37,8 @@ jobs:
4437
ARCH: "${{ matrix.arch}}"
4538
GOARCH: "${{ matrix.arch}}"
4639

47-
- name: Generate checksum files
40+
- name: Prepare Artifacts
4841
run: |
49-
ls -lR dist
5042
cd dist/artifacts
5143
sha256sum webhook-linux-${{ matrix.arch }} > sha256sum-${{ matrix.arch }}.txt
5244
@@ -67,10 +59,10 @@ jobs:
6759

6860
- name : Checkout repository
6961
# https://github.com/actions/checkout/releases/tag/v4.1.1
70-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
62+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
7163

7264
- name: package-helm
73-
run: ./scripts/package-helm
65+
run: make package-helm
7466

7567
- name: Download the amd64 artifacts
7668
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
@@ -116,27 +108,6 @@ jobs:
116108
# https://github.com/actions/checkout/releases/tag/v4.1.1
117109
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
118110

119-
- name: Download the artifacts
120-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
121-
# https://github.com/actions/download-artifact/releases/tag/v4.1.7
122-
with:
123-
name: webhook-artifacts-${{ matrix.arch }}
124-
path: dist/artifacts
125-
126-
- name: Move binary to bin/
127-
run: |
128-
mkdir -p bin/
129-
cp -v dist/artifacts/webhook-linux-${{ matrix.arch }} bin/webhook
130-
chmod +x bin/webhook
131-
132-
# PANDARIA
133-
# - name: "Read vault secrets"
134-
# uses: rancher-eio/read-vault-secrets@main
135-
# with:
136-
# secrets: |
137-
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
138-
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
139-
140111
- name: Set up QEMU
141112
# https://github.com/docker/setup-qemu-action/releases/tag/v3.1.0
142113
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
@@ -145,30 +116,34 @@ jobs:
145116
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
146117
# https://github.com/docker/setup-buildx-action/releases/tag/v3.4.0
147118

148-
- name: Log in to the Container registry
149-
# https://github.com/docker/login-action/releases/tag/v3.2.0
150-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
151-
with:
152-
registry: ${{ env.REGISTRY }}
153-
username: ${{ secrets.TCR_USERNAME }}
154-
password: ${{ secrets.TCR_TOKEN }}
155-
156119
- name: Build and push the webhook image
157-
id: build
158-
# https://github.com/docker/build-push-action/releases/tag/v6.3.0
159-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
120+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
160121
with:
161122
context: .
162123
file: ./package/Dockerfile
124+
secrets: |
125+
token=${{ secrets.RD_ONLY_GH_TOKEN }}
163126
platforms: "linux/${{ matrix.arch }}"
164127
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook,push-by-digest=true,name-canonical=true,push=true
128+
build-args: |
129+
VERSION=${{ env.VERSION }}
130+
COMMIT=${{ env.COMMIT }}
131+
GOPRIVATE=github.com/cnrancher
165132
166133
- name: Export digest
167134
run: |
168135
mkdir -p /tmp/digests
169136
digest="${{ steps.build.outputs.digest }}"
170137
touch "/tmp/digests/${digest#sha256:}"
171138
139+
- name: Log in to the Container registry
140+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
141+
# https://github.com/docker/login-action/releases/tag/v3.2.0
142+
with:
143+
registry: ${{ env.REGISTRY }}
144+
username: ${{ secrets.TCR_USERNAME }}
145+
password: ${{ secrets.TCR_TOKEN }}
146+
172147
- name: Upload digest
173148
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
174149
# https://github.com/actions/upload-artifact/releases/tag/v4.3.3
@@ -194,18 +169,9 @@ jobs:
194169

195170
- name: Set up Docker Buildx
196171
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
197-
# https://github.com/docker/setup-buildx-action/releases/tag/v3.4.0
198-
199-
# PANDARIA
200-
# - name: "Read vault secrets"
201-
# uses: rancher-eio/read-vault-secrets@main
202-
# with:
203-
# secrets: |
204-
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
205-
# secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD
206172

207173
- name: Log in to the Container registry
208-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
174+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
209175
# https://github.com/docker/login-action/releases/tag/v3.2.0
210176
with:
211177
registry: ${{ env.REGISTRY }}
@@ -222,6 +188,7 @@ jobs:
222188
run: |
223189
docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook:${{ env.TAG_NAME }} \
224190
$(printf '${{ env.REGISTRY }}/${{ env.REPO }}/rancher-webhook@sha256:%s ' *)
191+
225192
image-sign:
226193
permissions:
227194
contents: read
Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
#!/bin/bash
2-
32
set -eu
43

5-
REPO_URL=https://github.com/rancher/k3d
6-
K3D_URL=https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh
4+
# renovate: datasource=github-release-attachments depName=k3d-io/k3d
5+
K3D_VERSION=v5.8.3
6+
# renovate: datasource=github-release-attachments depName=k3d-io/k3d digestVersion=v5.8.3
7+
K3D_SUM_linux_amd64=dbaa79a76ace7f4ca230a1ff41dc7d8a5036a8ad0309e9c54f9bf3836dbe853e
8+
# renovate: datasource=github-release-attachments depName=k3d-io/k3d digestVersion=v5.8.3
9+
K3D_SUM_linux_arm64=0b8110f2229631af7402fb828259330985918b08fefd38b7f1b788a1c8687216
10+
# renovate: datasource=github-release-attachments depName=k3d-io/k3d digestVersion=v5.8.3
11+
K3D_SUM_darwin_amd64=fd0f8e9e8ea4d8bc3674572ca6ed0833b639bf57c43c708616d937377324cfea
12+
# renovate: datasource=github-release-attachments depName=k3d-io/k3d digestVersion=v5.8.3
13+
K3D_SUM_darwin_arm64=8da468daa7dc7cf7cdd4735f90a9bb05179fa27858250f62e3d8cdf5b5ca0698
14+
15+
DEST_DIR="./bin"
16+
mkdir -p "${DEST_DIR}"
17+
18+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
19+
ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/')
20+
21+
eval "K3D_SUM=\$K3D_SUM_${OS}_${ARCH}"
22+
23+
if [ -z "${K3D_SUM}" ]; then
24+
echo "Unsupported platform: ${OS}-${ARCH}" >&2
25+
exit 1
26+
fi
27+
28+
BINARY_NAME="k3d-${OS}-${ARCH}"
29+
URL="https://github.com/k3d-io/k3d/releases/download/${K3D_VERSION}/${BINARY_NAME}"
730

8-
install_k3d(){
9-
if [ -z "${K3D_VERSION:-}" -o "${K3D_VERSION:-}" = "latest" ] ; then
10-
K3D_VERSION=$(curl -Ls -o /dev/null -w %{url_effective} "${REPO_URL}/releases/latest" | grep -oE "[^/]+$")
11-
fi
12-
echo -e "Downloading k3d@${K3D_VERSION} from ${K3D_URL}"
13-
curl --silent --fail ${K3D_URL} | TAG=${K3D_VERSION} bash
14-
}
31+
echo "Downloading k3d ${K3D_VERSION}..."
32+
curl -sfL "${URL}" -o "${DEST_DIR}/k3d"
1533

16-
install_k3d
34+
echo "Verifying checksum..."
35+
echo "${K3D_SUM} ${DEST_DIR}/k3d" | sha256sum --check
1736

18-
k3d version
37+
chmod +x "${DEST_DIR}/k3d"
38+
echo "k3d installed to ${DEST_DIR}/k3d"

.github/workflows/scripts/integration-test-ci

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ set -eu
44
cd $(dirname $0)/../../..
55
DIST_DIR="$PWD"/dist
66

7+
# Build the integration test binary
8+
make integration-test-binary ARCH=${ARCH}
9+
710
source ./scripts/version
811
# Source tags file to get the last built tags
912
source ./dist/tags

0 commit comments

Comments
 (0)