From 4b6f07b90d778c506a7d230376b0ffe5726895f4 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Fri, 3 May 2024 22:37:30 -0500 Subject: [PATCH 1/2] Use skopeo to sync csi images to canonical org --- .github/data/sync-csi-images-config.yaml | 6 +++++ .github/workflows/sync-csi-images.yaml | 23 +++++++++++++++++++ .../templates/01-controller-plugin.yaml | 2 +- .../rawfile-csi/templates/01-node-plugin.yaml | 6 ++--- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .github/data/sync-csi-images-config.yaml create mode 100644 .github/workflows/sync-csi-images.yaml diff --git a/.github/data/sync-csi-images-config.yaml b/.github/data/sync-csi-images-config.yaml new file mode 100644 index 0000000..6e6adce --- /dev/null +++ b/.github/data/sync-csi-images-config.yaml @@ -0,0 +1,6 @@ +k8s.gcr.io/sig-storage: + images-by-semver: + csi-node-driver-registrar: "= v2.10.0" + csi-provisioner: "= v3.4.1" + csi-resizer: "= v1.7.0" + csi-snapshotter: "= v6.2.1" diff --git a/.github/workflows/sync-csi-images.yaml b/.github/workflows/sync-csi-images.yaml new file mode 100644 index 0000000..c35d169 --- /dev/null +++ b/.github/workflows/sync-csi-images.yaml @@ -0,0 +1,23 @@ +name: Synchronize CSI Images + +on: + push: + branches: + - "KU-384/sync-csi-images" + schedule: + - cron: "0 0 * * *" # Runs every midnight +jobs: + synchronize: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Skopeo Sync + run: | + docker run -v ${GITHUB_WORKSPACE}:/tmp/ quay.io/skopeo/stable:v1.15 sync \ + --src yaml \ + --dest docker \ + /tmp/.github/data/sync-csi-images-config.yaml ghcr.io/canonical/sig-storage \ + --format oci \ + --dest-creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml b/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml index ff8b6c5..b021c62 100644 --- a/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml +++ b/deploy/charts/rawfile-csi/templates/01-controller-plugin.yaml @@ -69,7 +69,7 @@ spec: resources: {{- toYaml .Values.controller.resources | nindent 12 }} - name: external-resizer - image: k8s.gcr.io/sig-storage/csi-resizer:v1.7.0 + image: ghcr.io/canonical/sig-storage/csi-resizer:v1.7.0 imagePullPolicy: IfNotPresent args: - "--csi-address=$(ADDRESS)" diff --git a/deploy/charts/rawfile-csi/templates/01-node-plugin.yaml b/deploy/charts/rawfile-csi/templates/01-node-plugin.yaml index 1ed9058..d360090 100644 --- a/deploy/charts/rawfile-csi/templates/01-node-plugin.yaml +++ b/deploy/charts/rawfile-csi/templates/01-node-plugin.yaml @@ -91,7 +91,7 @@ spec: resources: {{- toYaml .Values.node.resources | nindent 12 }} - name: node-driver-registrar - image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.10.0 + image: ghcr.io/canonical/sig-storage/csi-node-driver-registrar:v2.10.0 imagePullPolicy: IfNotPresent args: - --csi-address=$(ADDRESS) @@ -124,7 +124,7 @@ spec: cpu: 10m memory: 100Mi - name: external-provisioner - image: k8s.gcr.io/sig-storage/csi-provisioner:v3.4.1 + image: ghcr.io/canonical/sig-storage/csi-provisioner:v3.4.1 imagePullPolicy: IfNotPresent args: - "--csi-address=$(ADDRESS)" @@ -154,7 +154,7 @@ spec: - name: socket-dir mountPath: /csi - name: external-snapshotter - image: k8s.gcr.io/sig-storage/csi-snapshotter:v6.2.1 + image: ghcr.io/canonical/sig-storage/csi-snapshotter:v6.2.1 imagePullPolicy: IfNotPresent args: - "--csi-address=$(ADDRESS)" From 2fef5be4b8d9bb60204f4394d65882a78dd14aa8 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Fri, 3 May 2024 22:54:40 -0500 Subject: [PATCH 2/2] Cleanup action and remove runs on pull req from branch --- .github/workflows/sync-csi-images.yaml | 35 ++++++++++++-------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/sync-csi-images.yaml b/.github/workflows/sync-csi-images.yaml index c35d169..b4c972c 100644 --- a/.github/workflows/sync-csi-images.yaml +++ b/.github/workflows/sync-csi-images.yaml @@ -1,23 +1,20 @@ name: Synchronize CSI Images on: - push: - branches: - - "KU-384/sync-csi-images" - schedule: - - cron: "0 0 * * *" # Runs every midnight + schedule: + - cron: "0 0 * * *" # Runs every midnight jobs: - synchronize: - runs-on: ubuntu-22.04 - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Skopeo Sync - run: | - docker run -v ${GITHUB_WORKSPACE}:/tmp/ quay.io/skopeo/stable:v1.15 sync \ - --src yaml \ - --dest docker \ - /tmp/.github/data/sync-csi-images-config.yaml ghcr.io/canonical/sig-storage \ - --format oci \ - --dest-creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + synchronize: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Skopeo Sync + run: | + docker run -v ${GITHUB_WORKSPACE}:/tmp/ quay.io/skopeo/stable:v1.15 sync \ + --src yaml \ + --dest docker \ + /tmp/.github/data/sync-csi-images-config.yaml ghcr.io/canonical/sig-storage \ + --format oci \ + --dest-creds ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \ No newline at end of file