Skip to content

Commit

Permalink
update hack/generate-kind-config.sh to handle multiple mirrors (#5977)
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis authored Jun 8, 2021
1 parent 16f7510 commit 910eb4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,26 @@ jobs:
- C:\\Users\\travis\\AppData\\Local\\go-build
- name: "kind integration partition 0"
<<: *integration_test
<<: *upgrade_docker
<<: *registry_mirror
script:
- env IT_PARTITION=0 make integration-in-kind
- name: "kind integration partition 1"
<<: *integration_test
<<: *upgrade_docker
<<: *registry_mirror
script:
- env IT_PARTITION=1 make integration-in-kind
- name: "kind integration partition 2"
<<: *integration_test
<<: *upgrade_docker
<<: *registry_mirror
script:
- env IT_PARTITION=2 make integration-in-kind
- name: "kind integration partition 3"
<<: *integration_test
<<: *upgrade_docker
<<: *registry_mirror
script:
- env IT_PARTITION=3 make integration-in-kind
- name: "k3d integration partition 0"
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-kind-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.

# Create a kind configuration to use the docker daemon's configured registry-mirrors.
docker system info --format '{{printf "apiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\ncontainerdConfigPatches:\n"}}{{range $reg, $config := .RegistryConfig.IndexConfigs}}{{if $config.Mirrors}}{{printf "- |-\n [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"%s\"]\n endpoint = %q\n" $reg $config.Mirrors}}{{end}}{{end}}'
docker system info --format '{{printf "apiVersion: kind.x-k8s.io/v1alpha4\nkind: Cluster\ncontainerdConfigPatches:\n"}}{{range $reg, $config := .RegistryConfig.IndexConfigs}}{{if $config.Mirrors}}{{printf "- |-\n [plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"%s\"]\n endpoint = [" $reg}}{{range $index, $mirror := $config.Mirrors}}{{if $index}},{{end}}{{printf "%q" $mirror}}{{end}}{{printf "]\n"}}{{end}}{{end}}'

0 comments on commit 910eb4e

Please sign in to comment.