Skip to content

Commit

Permalink
Merge pull request #695 from furkatgofurov7/bump-go-1-23
Browse files Browse the repository at this point in the history
🌱 Bump Go version to 1.23.0
  • Loading branch information
k8s-ci-robot authored Jan 28, 2025
2 parents 7e7d5cc + 5c3f4c8 commit 3a0909a
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 37 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ jobs:
name: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
working-directory:
- ""
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # tag=v5.1.0
with:
go-version: '1.22'
go-version: ${{ steps.vars.outputs.go_version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # tag=v6.1.1
with:
version: v1.57.2
args: --timeout 15m
version: v1.60.2
args: --timeout 15m
2 changes: 1 addition & 1 deletion .github/workflows/pr-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
with:
# go-version: ${{ steps.vars.outputs.go_version }} // TODO: we have to use go version consistent with test infra jobs
go-version: '1.22'
go-version: '1.23'
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # tag=v4.2.0
name: Restore go cache
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
run:
timeout: 5m
go: "1.22"
go: "1.23"
skip-files:
- "zz_generated.*\\.go$"
allow-parallel-runners: true
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ROOT:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

.DEFAULT_GOAL:=help

GO_VERSION ?= 1.22.11
GO_VERSION ?= 1.23.0
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)

# Use GOPROXY environment variable if set
Expand Down Expand Up @@ -70,7 +70,7 @@ CONTROLLER_GEN_VER := v0.16.1
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)

GOLANGCI_LINT_VER := v1.57.2
GOLANGCI_LINT_VER := v1.60.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def build_image():
"SECURITY_CONTACTS"
],
build_args = {
"builder_image": "docker.io/library/golang:1.22.11",
"builder_image": "docker.io/library/golang:1.23.0",
}
)

Expand Down
8 changes: 6 additions & 2 deletions cmd/plugin/cmd/upgrade_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,14 @@ func runUpgradePlan() error {

w := tabwriter.NewWriter(os.Stdout, 10, 4, 3, ' ', 0)

fmt.Fprintln(w, "NAME\tNAMESPACE\tTYPE\tCURRENT VERSION\tNEXT VERSION")
if _, err := fmt.Fprintln(w, "NAME\tNAMESPACE\tTYPE\tCURRENT VERSION\tNEXT VERSION"); err != nil {
return err
}

for _, upgradeItem := range upgradePlan.Providers {
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", upgradeItem.Name, upgradeItem.Namespace, upgradeItem.Type, upgradeItem.CurrentVersion, prettifyTargetVersion(upgradeItem.NextVersion))
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", upgradeItem.Name, upgradeItem.Namespace, upgradeItem.Type, upgradeItem.CurrentVersion, prettifyTargetVersion(upgradeItem.NextVersion)); err != nil {
return err
}

if upgradeItem.NextVersion != "" {
upgradeAvailable = true
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/cluster-api-operator

go 1.22.0

toolchain go1.22.11
go 1.23.0

require (
github.com/MakeNowJust/heredoc v1.0.0
Expand Down
4 changes: 1 addition & 3 deletions hack/chart-update/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/cluster-api-operator/hack/chart-update

go 1.22.0

toolchain go1.22.11
go 1.23.0

require (
github.com/google/go-github/v50 v50.2.0
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EOF
local go_version
IFS=" " read -ra go_version <<< "$(go version)"
local minimum_go_version
minimum_go_version=go1.22.0
minimum_go_version=go1.23.0
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
cat <<EOF
Detected go version: ${go_version[*]}.
Expand Down
4 changes: 1 addition & 3 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/cluster-api-operator/hack/tools

go 1.22.0

toolchain go1.22.11
go 1.23.0

replace (
sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.4
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/component_customizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ func customizeDeployment(dSpec *operatorv1.DeploymentSpec, mSpec *operatorv1.Man

func customizeDeploymentSpec(dSpec operatorv1.DeploymentSpec, d *appsv1.Deployment) {
if dSpec.Replicas != nil {
d.Spec.Replicas = ptr.To(int32(*dSpec.Replicas))
replicas := int32(*dSpec.Replicas) //nolint:gosec
d.Spec.Replicas = ptr.To(replicas)
}

if dSpec.Affinity != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/genericprovider_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (r *GenericProviderReconciler) reconcile(ctx context.Context, provider gene
if err != nil {
var pe *PhaseError
if errors.As(err, &pe) {
conditions.Set(provider, conditions.FalseCondition(pe.Type, pe.Reason, pe.Severity, err.Error()))
conditions.Set(provider, conditions.FalseCondition(pe.Type, pe.Reason, pe.Severity, "%s", err.Error()))
}
}

Expand Down Expand Up @@ -214,7 +214,7 @@ func (r *GenericProviderReconciler) reconcileDelete(ctx context.Context, provide
if err != nil {
var pe *PhaseError
if errors.As(err, &pe) {
conditions.Set(provider, conditions.FalseCondition(pe.Type, pe.Reason, pe.Severity, err.Error()))
conditions.Set(provider, conditions.FalseCondition(pe.Type, pe.Reason, pe.Severity, "%s", err.Error()))
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/oci_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (m mapStore) Exists(ctx context.Context, target ocispec.Descriptor) (bool,

// Fetch implements oras.Target.
func (m mapStore) Fetch(ctx context.Context, target ocispec.Descriptor) (io.ReadCloser, error) {
return nil, nil
return nil, nil //nolint:nilnil
}

// Push implements oras.Target.
Expand Down
10 changes: 5 additions & 5 deletions internal/controller/preflight_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
operatorv1.PreflightCheckCondition,
operatorv1.IncorrectCoreProviderNameReason,
clusterv1.ConditionSeverityError,
fmt.Sprintf(incorrectCoreProviderNameMessage, provider.GetName(), configclient.ClusterAPIProviderName),
"%s", fmt.Sprintf(incorrectCoreProviderNameMessage, provider.GetName(), configclient.ClusterAPIProviderName),
))

return ctrl.Result{}, fmt.Errorf("incorrect CoreProvider name: %s, it should be %s", provider.GetName(), configclient.ClusterAPIProviderName)
Expand Down Expand Up @@ -129,7 +129,7 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
operatorv1.PreflightCheckCondition,
operatorv1.InvalidGithubTokenReason,
clusterv1.ConditionSeverityError,
invalidGithubTokenMessage,
"%s", invalidGithubTokenMessage,
))

return ctrl.Result{}, fmt.Errorf("failed to validate provided github token: %w", err)
Expand Down Expand Up @@ -187,7 +187,7 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
operatorv1.PreflightCheckCondition,
operatorv1.WaitingForCoreProviderReadyReason,
clusterv1.ConditionSeverityInfo,
waitingForCoreProviderReadyMessage,
"%s", waitingForCoreProviderReadyMessage,
))

return ctrl.Result{RequeueAfter: preflightFailedRequeueAfter}, nil
Expand All @@ -213,7 +213,7 @@ func checkProviderVersion(ctx context.Context, providerVersion string, provider
operatorv1.PreflightCheckCondition,
operatorv1.IncorrectVersionFormatReason,
clusterv1.ConditionSeverityError,
err.Error(),
"%s", err.Error(),
))

return fmt.Errorf("version contains invalid value for provider %q", provider.GetName())
Expand All @@ -231,7 +231,7 @@ func checkProviderVersion(ctx context.Context, providerVersion string, provider
operatorv1.PreflightCheckCondition,
operatorv1.UnsupportedProviderDowngradeReason,
clusterv1.ConditionSeverityError,
fmt.Sprintf(unsupportedProviderDowngradeMessage, provider.GetName()),
"%s", unsupportedProviderDowngradeMessage,
))

return fmt.Errorf("downgrade is not supported for provider %q", provider.GetName())
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
publish = "docs/book/book"

[build.environment]
GO_VERSION = "1.22.11"
GO_VERSION = "1.23.0"

# Standard Netlify redirects
[[redirects]]
Expand Down
4 changes: 1 addition & 3 deletions test/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/cluster-api-operator/test

go 1.22.0

toolchain go1.22.11
go 1.23.0

replace sigs.k8s.io/cluster-api-operator => ../

Expand Down

0 comments on commit 3a0909a

Please sign in to comment.