From a9cd66e68501ee357f4f9b8258612f5ae4327eec Mon Sep 17 00:00:00 2001 From: liujian <54946465+redscholar@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:25:27 +0800 Subject: [PATCH] Revert "fix: failed to install without image_registry (#2446)" (#2447) This reverts commit f8840359871ea8915e97aa90c16c243ee48c60dc. --- .github/workflows/sync-vendor.yml | 5 +++-- builtin/roles/install/cri/defaults/main.yaml | 2 +- builtin/roles/install/image-registry/defaults/main.yaml | 2 +- go.mod | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-vendor.yml b/.github/workflows/sync-vendor.yml index 0a415d682..1a53f390a 100644 --- a/.github/workflows/sync-vendor.yml +++ b/.github/workflows/sync-vendor.yml @@ -37,8 +37,9 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: + token: "${{ secrets.GITHUB_TOKEN }}" commit-message: "Add vendor directory" - branch: "add-vendor-${{ github.sha }}" + branch: "add-vendor-${{ github.event.number }}" title: "[ci-bot] Add vendor directory" body: | - This [PR](https://github.com/kubesphere/kubekey/pull/${{ github.sha }}) adds the vendor directory generated by go mod vendor. + This [PR](https://github.com/kubesphere/kubekey/pull/${{ github.event.number }}) adds the vendor directory generated by go mod vendor. diff --git a/builtin/roles/install/cri/defaults/main.yaml b/builtin/roles/install/cri/defaults/main.yaml index 208f01050..c116584eb 100644 --- a/builtin/roles/install/cri/defaults/main.yaml +++ b/builtin/roles/install/cri/defaults/main.yaml @@ -25,7 +25,7 @@ image_registry: registry: | {{- if and .image_registry.ha_vip (ne .image_registry.ha_vip "") }} {{ .image_registry.ha_vip }} - {{- else if .groups.image_registry | default list | len | lt 0 }} + {{- else }} {{ index .inventory_hosts (.groups.image_registry | default list | first) "internal_ipv4" }} {{- end }} username: admin diff --git a/builtin/roles/install/image-registry/defaults/main.yaml b/builtin/roles/install/image-registry/defaults/main.yaml index a40c2af1c..1b5c0e82b 100644 --- a/builtin/roles/install/image-registry/defaults/main.yaml +++ b/builtin/roles/install/image-registry/defaults/main.yaml @@ -5,7 +5,7 @@ image_registry: registry: | {{- if and .image_registry.ha_vip (ne .image_registry.ha_vip "") }} {{ .image_registry.ha_vip }} - {{- else if .groups.image_registry | default list | len | lt 0 }} + {{- else }} {{ index .inventory_hosts (.groups.image_registry | default list | first) "internal_ipv4" }} {{- end }} username: admin diff --git a/go.mod b/go.mod index e1484eb13..84dab9874 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubesphere/kubekey/v4 -go 1.23.0 +go 1.22.0 require ( github.com/Masterminds/sprig/v3 v3.2.3