Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lts updates #85

Open
wants to merge 5 commits into
base: ecm-test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
- master
pull_request:


permissions:
contents: read
id-token: write
security-events: write # upload Sarif results

name: Build
Expand All @@ -17,6 +17,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY

- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
repositories: release-multus-cni
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Set the TAG value
id: get-TAG
run: |
Expand All @@ -32,6 +47,7 @@ jobs:
target: multus-thin
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni

- name: Build thick plugin image
uses: docker/build-push-action@v6
Expand All @@ -43,6 +59,7 @@ jobs:
target: multus-thick
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
Expand All @@ -65,6 +82,21 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4

- name: "Read secrets"
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY

- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
repositories: release-multus-cni
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -76,6 +108,7 @@ jobs:
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"

- name: Build container image
uses: docker/build-push-action@v6
with:
Expand All @@ -88,6 +121,7 @@ jobs:
platforms: linux/arm64
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni

- name: Build thick plugin image
uses: docker/build-push-action@v6
Expand All @@ -101,3 +135,4 @@ jobs:
platforms: linux/arm64
build-args: |
TAG=${{ env.TAG }}
SRC=x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME_REGISTRY ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME_REGISTRY_USERNAME ;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME_REGISTRY_PASSWORD ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/release-app-credentials privateKey | PRIVATE_KEY

- name: Build and push thin plugin image
uses: rancher/ecm-distro-tools/actions/publish-image@master
Expand All @@ -50,6 +50,8 @@ jobs:

- name: Build and push thick plugin image
uses: rancher/ecm-distro-tools/actions/publish-image@master
env:
SRC: x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/release-multus-cni
with:
image: hardened-multus-thick
tag: ${{ github.event.release.tag_name }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN set -x && \
# Build the multus project
FROM base-builder AS multus-builder
ARG TAG=v4.1.4
ARG SRC=github.com/k8snetworkplumbingwg/multus-cni
ARG SRC=github.com/rancher/release-multus-cni
ARG PKG=github.com/k8snetworkplumbingwg/multus-cni
RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
Expand All @@ -41,7 +41,7 @@ RUN strip /thin_entrypoint /multus /kubeconfig_generator /cert-approver /install

# Create the multus image
FROM scratch AS multus-thin
COPY --from=strip_binary /multus /usr/src/multus-cni/bin/multus
COPY --from=strip_binary /multus /usr/src/multus-cni/bin/multus
COPY --from=multus-builder /go/src/github.com/k8snetworkplumbingwg/multus-cni/LICENSE /usr/src/multus-cni/LICENSE
COPY --from=strip_binary /thin_entrypoint /
COPY --from=strip_binary /kubeconfig_generator /
Expand Down