Skip to content

Commit dad50f2

Browse files
authored
ci: fix docker pull rate limit issue (#650)
1 parent e0c6619 commit dad50f2

5 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Patch kind config
2+
description: Patch kind config to add registry mirror with authentication.
3+
inputs:
4+
kind_config_path:
5+
description: 'Path to the kind config file'
6+
required: false
7+
default: $PWD/config/kind.yaml
8+
registry-username:
9+
description: Username for registry
10+
required: true
11+
registry-password:
12+
description: Password for registry
13+
required: true
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Patch kind config for registry mirror
19+
shell: bash
20+
run: |
21+
KIND_CONFIG_PATH="${{ inputs.kind_config_path }}"
22+
cat <<EOF > patches.yaml
23+
containerdConfigPatches:
24+
- |-
25+
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
26+
endpoint = ["https://registry.ci.mirantis.com/v2/dockerhub"]
27+
- |-
28+
[plugins."io.containerd.grpc.v1.cri".registry.configs."registry.ci.mirantis.com".auth]
29+
username = "${{ inputs.registry-username }}"
30+
password = "${{ inputs.registry-password }}"
31+
EOF
32+
sed -i '/apiVersion: kind.x-k8s.io\/v1alpha4/r patches.yaml' ${KIND_CONFIG_PATH}
33+
rm patches.yaml

.github/workflows/pr_test_adopted_upgrade.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ jobs:
7878
with:
7979
path: kcm-repo/bin
8080
key: kcm-cli-${{ runner.os }}-${{ steps.kcm_release.outputs.release }}-${{ github.run_id }}
81+
- name: Patch Kind Config
82+
if: github.repository_owner == 'k0rdent'
83+
uses: ./.github/actions/kind-config-patch
84+
with:
85+
registry-username: ${{ secrets.REGISTRY_CI_USERNAME }}
86+
registry-password: ${{ secrets.REGISTRY_CI_PASSWORD }}
87+
8188
- name: "[Latest release] Create KIND kcm cluster"
8289
run: |
8390
export KIND_CONFIG_PATH=$PWD/config/kind.yaml

.github/workflows/pr_test_helm_chart.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ jobs:
110110
with:
111111
path: kcm-repo/bin
112112
key: kcm-cli-${{ runner.os }}-${{ github.sha }}-${{ github.run_id }}
113+
- name: Patch Kind Config
114+
if: github.repository_owner == 'k0rdent'
115+
uses: ./.github/actions/kind-config-patch
116+
with:
117+
registry-username: ${{ secrets.REGISTRY_CI_USERNAME }}
118+
registry-password: ${{ secrets.REGISTRY_CI_PASSWORD }}
113119
- name: Apply KCM Dev Configuration
114120
run: |
115121
export KIND_CONFIG_PATH=$PWD/config/kind.yaml

.github/workflows/pr_test_kof_installation.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ jobs:
4444
- name: "[Main Branch] Install KCM CLI"
4545
run: |
4646
make -C kcm-repo cli-install
47+
- name: Patch Kind Config
48+
if: github.repository_owner == 'k0rdent'
49+
uses: ./.github/actions/kind-config-patch
50+
with:
51+
registry-username: ${{ secrets.REGISTRY_CI_USERNAME }}
52+
registry-password: ${{ secrets.REGISTRY_CI_PASSWORD }}
4753
- name: "[Main Branch] Create KIND kcm cluster"
4854
run: |
4955
make kcm-dev-apply KCM_REPO_PATH="kcm-repo" KIND_CONFIG_PATH="$PWD/config/kind.yaml"

.github/workflows/pr_test_mgmt_upgrade.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ jobs:
7272
with:
7373
path: kcm-repo/bin
7474
key: kcm-cli-${{ runner.os }}-${{ steps.kcm_release.outputs.release }}-${{ github.run_id }}
75+
- name: Patch Kind Config
76+
if: github.repository_owner == 'k0rdent'
77+
uses: ./.github/actions/kind-config-patch
78+
with:
79+
registry-username: ${{ secrets.REGISTRY_CI_USERNAME }}
80+
registry-password: ${{ secrets.REGISTRY_CI_PASSWORD }}
7581
- name: "[Latest release] Create KIND kcm cluster"
7682
run: |
7783
export KIND_CONFIG_PATH=$PWD/config/kind.yaml

0 commit comments

Comments
 (0)