Skip to content

Commit

Permalink
Merge pull request #397 from jacobweinstock/update-go
Browse files Browse the repository at this point in the history
Update to Go 1.23:

## Description

<!--- Please describe what this PR is going to change -->
Update to Go 1.23

## Why is this needed

<!--- Link to issue you have raised -->

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
jacobweinstock authored Sep 11, 2024
2 parents 9ea059f + a7cdb91 commit 5e0a803
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
CGO_ENABLED: 0
GO_VERSION: '1.21'
GO_VERSION: '1.23'
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
GO_VERSION: '1.21'
GO_VERSION: '1.23'

jobs:
manager-image:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ linters:
- errorlint
- exhaustive
# - exhaustivestruct
- exportloopref
- copyloopvar
- forbidigo
- forcetypeassert
- funlen
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
ARG GOVER=1.21
ARG GOVER=1.23
FROM golang:${GOVER} as builder

Check warning on line 17 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push manager image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /workspace
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ GO_INSTALL = ./scripts/go_install.sh
# Binaries.
CONTROLLER_GEN := go run sigs.k8s.io/controller-tools/cmd/[email protected]

GOLANGCI_LINT_VER := v1.59.1
GOLANGCI_LINT_VER := v1.61.0
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)

Expand Down Expand Up @@ -107,7 +107,7 @@ endif
# Build time versioning details.
LDFLAGS := $(shell hack/version.sh)

GOLANG_VERSION := 1.21
GOLANG_VERSION := 1.23

## --------------------------------------
## Help
Expand Down
2 changes: 0 additions & 2 deletions controller/machine/hardware.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ func byHardwareAffinity(hardware []tinkv1.Hardware, preferred []infrastructurev1
scores := map[client.ObjectKey]int32{}
// compute scores for each item based on the preferred term weights
for _, term := range preferred {
term := term

selector, err := metav1.LabelSelectorAsSelector(&term.HardwareAffinityTerm.LabelSelector)
if err != nil {
return nil, fmt.Errorf("constructing label selector: %w", err)
Expand Down
2 changes: 0 additions & 2 deletions controller/machine/scope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ func Test_Machine(t *testing.T) {
}

for name, c := range cases {
name, c := name, c

t.Run(name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down
2 changes: 0 additions & 2 deletions controller/machine/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ func Test_Cloud_config_template(t *testing.T) {
}

for name, c := range cases {
c := c

t.Run(name, func(t *testing.T) {
t.Parallel()
g := NewWithT(t)
Expand Down
4 changes: 2 additions & 2 deletions controller/machine/tinkerbellmachine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func Test_Machine_reconciliation_with_available_hardware(t *testing.T) {
g.Expect(client.Get(ctx, hardwareNamespacedName, updatedHardware)).To(Succeed())

if diff := cmp.Diff(updatedHardware.Spec.Interfaces[0].Netboot.AllowPXE, ptr.To(true)); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
})
}
Expand Down Expand Up @@ -593,7 +593,7 @@ func Test_Machine_reconciliation_workflow_complete(t *testing.T) {
g.Expect(client.Get(ctx, hardwareNamespacedName, updatedHardware)).To(Succeed())

if diff := cmp.Diff(updatedHardware.Spec.Interfaces[0].Netboot.AllowPXE, ptr.To(false)); diff != "" {
t.Errorf(diff)
t.Error(diff)
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/tinkerbell/cluster-api-provider-tinkerbell

go 1.21.0
go 1.23.0

toolchain go1.21.2
toolchain go1.23.1

require (
github.com/go-logr/logr v1.4.1
Expand Down

0 comments on commit 5e0a803

Please sign in to comment.