From ee88eaf7300e139b4fe886ffaea0e5d99c24bb90 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 15 Aug 2024 14:56:55 +0200 Subject: [PATCH] Switch to go 1.23 Signed-off-by: Sascha Grunert --- .github/workflows/build.yml | 4 ++-- .github/workflows/containerd.yml | 2 +- .github/workflows/crio.yml | 2 +- .github/workflows/release.yml | 2 +- Makefile | 2 +- go.mod | 4 +--- pkg/common/file.go | 4 ++-- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c24477d1e0..0045570f56 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - name: Set env @@ -77,7 +77,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - name: Set env diff --git a/.github/workflows/containerd.yml b/.github/workflows/containerd.yml index 824b18e502..5173326652 100644 --- a/.github/workflows/containerd.yml +++ b/.github/workflows/containerd.yml @@ -50,7 +50,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: false - name: Set env diff --git a/.github/workflows/crio.yml b/.github/workflows/crio.yml index b09a2801df..1c271a759f 100644 --- a/.github/workflows/crio.yml +++ b/.github/workflows/crio.yml @@ -29,7 +29,7 @@ jobs: - name: Install go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' - name: Setup system run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3ee491193..869fcbeb80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' - run: make release-notes release env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/Makefile b/Makefile index 07a036f932..fbf596df25 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ install.lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT): export \ - VERSION=v1.59.1 \ + VERSION=v1.60.1 \ URL=https://raw.githubusercontent.com/golangci/golangci-lint \ BINDIR=${BUILD_BIN_PATH} && \ curl -sfL $$URL/$$VERSION/install.sh | sh -s $$VERSION diff --git a/go.mod b/go.mod index ac8acc5dc4..a4d03a6c99 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module sigs.k8s.io/cri-tools -go 1.22.0 - -toolchain go1.22.1 +go 1.23.0 require ( github.com/distribution/reference v0.6.0 diff --git a/pkg/common/file.go b/pkg/common/file.go index cc6f78eef4..0af620eded 100644 --- a/pkg/common/file.go +++ b/pkg/common/file.go @@ -81,7 +81,7 @@ func WriteConfig(c *Config, filepath string) error { func getConfigOptions(yamlData *yaml.Node) (*Config, error) { config := &Config{yamlData: yamlData} - if yamlData.Content == nil || len(yamlData.Content) == 0 || + if len(yamlData.Content) == 0 || yamlData.Content[0].Content == nil { return config, nil } @@ -142,7 +142,7 @@ func setConfigOptions(config *Config) { // Set config option on yaml. func setConfigOption(configName, configValue string, yamlData *yaml.Node) { - if yamlData.Content == nil || len(yamlData.Content) == 0 { + if len(yamlData.Content) == 0 { yamlData.Kind = yaml.DocumentNode yamlData.Content = make([]*yaml.Node, 1) yamlData.Content[0] = &yaml.Node{