Skip to content

Commit cb3bdd6

Browse files
authored
lts updates (#85)
1 parent 4704f89 commit cb3bdd6

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
- master
55
pull_request:
66

7-
87
permissions:
98
contents: read
9+
id-token: write
1010
security-events: write # upload Sarif results
1111

1212
name: Build
@@ -17,6 +17,21 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
1919

20+
- name: "Read secrets"
21+
uses: rancher-eio/read-vault-secrets@main
22+
with:
23+
secrets: |
24+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
25+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
26+
27+
- name: Create App Token
28+
uses: actions/create-github-app-token@v1
29+
id: app-token
30+
with:
31+
repositories: release-multus-cni
32+
app-id: ${{ env.APP_ID }}
33+
private-key: ${{ env.PRIVATE_KEY }}
34+
2035
- name: Set the TAG value
2136
id: get-TAG
2237
run: |
@@ -32,6 +47,7 @@ jobs:
3247
target: multus-thin
3348
build-args: |
3449
TAG=${{ env.TAG }}
50+
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
3551
3652
- name: Build thick plugin image
3753
uses: docker/build-push-action@v6
@@ -43,6 +59,7 @@ jobs:
4359
target: multus-thick
4460
build-args: |
4561
TAG=${{ env.TAG }}
62+
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
4663
4764
- name: Run Trivy vulnerability scanner
4865
uses: aquasecurity/[email protected]
@@ -65,6 +82,21 @@ jobs:
6582
steps:
6683
- name: Check out code
6784
uses: actions/checkout@v4
85+
86+
- name: "Read secrets"
87+
uses: rancher-eio/read-vault-secrets@main
88+
with:
89+
secrets: |
90+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
91+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
92+
93+
- name: Create App Token
94+
uses: actions/create-github-app-token@v1
95+
id: app-token
96+
with:
97+
repositories: release-multus-cni
98+
app-id: ${{ env.APP_ID }}
99+
private-key: ${{ env.PRIVATE_KEY }}
68100

69101
- name: Set up QEMU
70102
uses: docker/setup-qemu-action@v3
@@ -76,6 +108,7 @@ jobs:
76108
id: get-TAG
77109
run: |
78110
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"
111+
79112
- name: Build container image
80113
uses: docker/build-push-action@v6
81114
with:
@@ -88,6 +121,7 @@ jobs:
88121
platforms: linux/arm64
89122
build-args: |
90123
TAG=${{ env.TAG }}
124+
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
91125
92126
- name: Build thick plugin image
93127
uses: docker/build-push-action@v6
@@ -101,3 +135,4 @@ jobs:
101135
platforms: linux/arm64
102136
build-args: |
103137
TAG=${{ env.TAG }}
138+
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
uses: rancher-eio/read-vault-secrets@main
2828
with:
2929
secrets: |
30-
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
31-
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
3230
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
3331
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
34-
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD
32+
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD ;
33+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
34+
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY
3535
3636
- name: Build and push thin plugin image
3737
uses: rancher/ecm-distro-tools/actions/publish-image@master
@@ -50,6 +50,8 @@ jobs:
5050

5151
- name: Build and push thick plugin image
5252
uses: rancher/ecm-distro-tools/actions/publish-image@master
53+
env:
54+
SRC: x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
5355
with:
5456
image: hardened-multus-thick
5557
tag: ${{ github.event.release.tag_name }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN set -x && \
1414
# Build the multus project
1515
FROM base-builder AS multus-builder
1616
ARG TAG=v4.1.4
17-
ARG SRC=github.com/k8snetworkplumbingwg/multus-cni
17+
ARG SRC=github.com/rancher/release-multus-cni
1818
ARG PKG=github.com/k8snetworkplumbingwg/multus-cni
1919
RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
2020
WORKDIR $GOPATH/src/${PKG}
@@ -41,7 +41,7 @@ RUN strip /thin_entrypoint /multus /kubeconfig_generator /cert-approver /install
4141

4242
# Create the multus image
4343
FROM scratch AS multus-thin
44-
COPY --from=strip_binary /multus /usr/src/multus-cni/bin/multus
44+
COPY --from=strip_binary /multus /usr/src/multus-cni/bin/multus
4545
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/LICENSE /usr/src/multus-cni/LICENSE
4646
COPY --from=strip_binary /thin_entrypoint /
4747
COPY --from=strip_binary /kubeconfig_generator /

0 commit comments

Comments
 (0)