diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9403c334a..97fc478ad 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: GolangciLint on: pull_request: @@ -21,7 +21,7 @@ jobs: - name: Setup golang uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: 1.22.0 - name: Sync mod run: make generate-modules @@ -44,7 +44,7 @@ jobs: - name: Setup golang uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: 1.22.0 - name: Sync mod run: make generate-modules @@ -65,7 +65,7 @@ jobs: - name: Setup golang uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version: 1.22.0 - name: Sync mod run: make generate-modules diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 5b77b8e09..ebbd55d0e 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -1,4 +1,4 @@ -name: goreleaser +name: GoReleaser on: push: diff --git a/.github/workflows/sync-vendor.yml b/.github/workflows/sync-vendor.yml index 1a53f390a..ec765d422 100644 --- a/.github/workflows/sync-vendor.yml +++ b/.github/workflows/sync-vendor.yml @@ -1,8 +1,9 @@ -name: sync-vendor - +name: SyncVendor on: - push: + pull_request: + types: + - closed paths: - go.mod workflow_dispatch: @@ -14,7 +15,7 @@ jobs: vendor: name: sync vendor runs-on: self-runner-kubesphere - if: github.repository == 'kubesphere/kubekey' + if: github.repository == 'kubesphere/kubekey' && github.event.pull_request.merged == true steps: - name: Checkout code uses: actions/checkout@v3 @@ -22,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.22' + go-version: '1.22.0' - name: Run go mod vendor run: go mod vendor @@ -37,9 +38,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.event.number }}" + branch: "add-vendor-pr-${{ github.event.pull_request.number }}" title: "[ci-bot] Add vendor directory" body: | - This [PR](https://github.com/kubesphere/kubekey/pull/${{ github.event.number }}) adds the vendor directory generated by go mod vendor. + This PR adds the vendor directory generated by go mod vendor. + Related PR: ${{ github.event.pull_request.html_url }} diff --git a/Makefile b/Makefile index ab8e56910..d8c64469e 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ SHELL:=/usr/bin/env bash # # Go. # -GO_VERSION ?= 1.22 +GO_VERSION ?= 1.22.0 GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION) GOARCH ?= $(shell go env GOARCH) GOOS ?= $(shell go env GOOS) diff --git a/builtin/roles/install/cri/defaults/main.yaml b/builtin/roles/install/cri/defaults/main.yaml index c116584eb..208f01050 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 }} + {{- else if .groups.image_registry | default list | len | lt 0 }} {{ 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 1b5c0e82b..a40c2af1c 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 }} + {{- else if .groups.image_registry | default list | len | lt 0 }} {{ index .inventory_hosts (.groups.image_registry | default list | first) "internal_ipv4" }} {{- end }} username: admin diff --git a/go.mod b/go.mod index 84dab9874..10ced8cbc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubesphere/kubekey/v4 -go 1.22.0 +go 1.22.1 require ( github.com/Masterminds/sprig/v3 v3.2.3