Skip to content

Commit 17e996f

Browse files
Merge pull request #855 from salasberryfin/backport_release-0.24_bump_go_to_1.25.8
[release-0.24] chore: bump go to 1.25.8
2 parents dbc73e0 + 692a8f5 commit 17e996f

18 files changed

Lines changed: 33 additions & 22 deletions

File tree

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: golangci-lint
2525
uses: golangci/golangci-lint-action@v9.2.0
2626
with:
27-
version: v2.1.0
27+
version: v2.11.2
2828
working-directory: ${{matrix.working-directory}}
2929
args: --timeout=5m0s
3030
skip-cache: true

.golangci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "2"
22
run:
3-
go: "1.24"
3+
go: "1.25"
44
allow-parallel-runners: true
55
linters:
66
default: all
@@ -19,15 +19,18 @@ linters:
1919
- ireturn
2020
- maintidx
2121
- nestif
22+
- noinlineerr
2223
- nolintlint
2324
- nonamedreturns
2425
- paralleltest
26+
- prealloc
2527
- rowserrcheck
2628
- sqlclosecheck
2729
- tagliatelle
2830
- varnamelen
2931
- wastedassign
3032
- wrapcheck
33+
- wsl # use the new wsl_v5 instead
3134
settings:
3235
funlen:
3336
lines: 110
@@ -107,6 +110,9 @@ linters:
107110
- linters:
108111
- revive
109112
text: "package-comments: should have a package comment"
113+
- linters:
114+
- modernize
115+
text: "any: interface{}"
110116
paths:
111117
- zz_generated.*\.go$
112118
- conversion\.go

bootstrap/api/v1beta1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1beta1 contains API Schema definitions for the bootstrap v1beta1 API group
17+
package v1beta1
18+
1819
// +kubebuilder:object:generate=true
1920
// +groupName=bootstrap.cluster.x-k8s.io
20-
package v1beta1
2121

2222
import (
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

bootstrap/internal/cloudinit/controlplane_join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ func NewJoinControlPlane(input *ControlPlaneInput) ([]byte, error) {
4040
}
4141

4242
controlPlaneCloudJoinWithVersion := fmt.Sprintf(controlPlaneCloudInit, input.RKE2Version)
43-
userData, err := generate("JoinControlplane", controlPlaneCloudJoinWithVersion, input)
4443

44+
userData, err := generate("JoinControlplane", controlPlaneCloudJoinWithVersion, input)
4545
if err != nil {
4646
return nil, err
4747
}

bootstrap/internal/cloudinit/worker_join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ func NewJoinWorker(input *BaseUserData) ([]byte, error) {
6363
}
6464

6565
workerCloudJoinWithVersion := fmt.Sprintf(workerCloudInit, input.RKE2Version)
66-
userData, err := generate("JoinWorker", workerCloudJoinWithVersion, input)
6766

67+
userData, err := generate("JoinWorker", workerCloudJoinWithVersion, input)
6868
if err != nil {
6969
return nil, err
7070
}

bootstrap/internal/controllers/rke2config_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func (r *RKE2ConfigReconciler) handleClusterNotInitialized(ctx context.Context,
485485
yamlEncoder := yaml.NewEncoder(&buf)
486486
yamlEncoder.SetIndent(2)
487487

488-
err = yamlEncoder.Encode(&configStruct)
488+
err = yamlEncoder.Encode(&configStruct) //nolint:gosec // G117: we intentionally serialize EtcdS3AccessKey in ServerConfig
489489
if err != nil {
490490
return ctrl.Result{}, fmt.Errorf("unable to marshal config.yaml: %w", err)
491491
}
@@ -732,7 +732,7 @@ func (r *RKE2ConfigReconciler) joinControlplane(ctx context.Context, scope *Scop
732732
yamlEncoder := yaml.NewEncoder(&buf)
733733
yamlEncoder.SetIndent(2)
734734

735-
err = yamlEncoder.Encode(&configStruct)
735+
err = yamlEncoder.Encode(&configStruct) //nolint:gosec // G117: we intentionally serialize EtcdS3AccessKey in ServerConfig
736736
if err != nil {
737737
return ctrl.Result{}, fmt.Errorf("unable to marshal config.yaml: %w", err)
738738
}

controlplane/api/v1beta1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1beta1 contains API Schema definitions for the controlplane v1beta1 API group
17+
package v1beta1
18+
1819
// +kubebuilder:object:generate=true
1920
// +groupName=controlplane.cluster.x-k8s.io
20-
package v1beta1
2121

2222
import (
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

controlplane/api/v1beta1/rke2controlplanetemplate_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ type RKE2ControlPlaneTemplate struct {
5151
type RKE2ControlPlaneTemplateList struct {
5252
metav1.TypeMeta `json:",inline"`
5353
metav1.ListMeta `json:"metadata,omitempty"`
54-
Items []RKE2ControlPlaneTemplate `json:"items"`
54+
55+
Items []RKE2ControlPlaneTemplate `json:"items"`
5556
}
5657

5758
func init() { //nolint:gochecknoinits

controlplane/api/v1beta2/condition_consts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const (
347347
// RKE2ControlPlaneCertificatesAvailableCondition documents the overall status of the certificates generated by the RKE2ControlPlane.
348348
RKE2ControlPlaneCertificatesAvailableCondition = "CertificatesAvailable"
349349

350-
// RKE2ControlPlaneCertificatesAvailableInternalErrorReason documents a failure in generating the certificates.
350+
// RKE2ControlPlaneCertificatesInternalErrorReason documents a failure in generating the certificates.
351351
RKE2ControlPlaneCertificatesInternalErrorReason = clusterv1.InternalErrorReason
352352

353353
// RKE2ControlPlaneCertificatesAvailableReason surfaces when cluster certificates are available,

controlplane/internal/controllers/scale.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ func (r *RKE2ControlPlaneReconciler) computeDesiredMachine(
598598
// Add the annotations from the MachineTemplate.
599599
// Note: we intentionally don't use the map directly to ensure we don't modify the map in RKE2ControlPlane.
600600
for k, v := range rcp.Spec.MachineTemplate.ObjectMeta.Annotations {
601-
desiredMachine.Annotations[k] = v
601+
desiredMachine.Annotations[k] = v //nolint:modernize
602602
}
603603

604604
for k, v := range annotations {
605-
desiredMachine.Annotations[k] = v
605+
desiredMachine.Annotations[k] = v //nolint:modernize
606606
}
607607

608608
// Set other in-place mutable fields
@@ -622,7 +622,7 @@ func ControlPlaneMachineLabelsForCluster(rcp *controlplanev1.RKE2ControlPlane, c
622622
// Add the labels from the MachineTemplate.
623623
// Note: we intentionally don't use the map directly to ensure we don't modify the map in RKE2ControlPlane.
624624
for k, v := range rcp.Spec.MachineTemplate.ObjectMeta.Labels {
625-
labels[k] = v
625+
labels[k] = v //nolint:modernize
626626
}
627627

628628
// Always force these labels over the ones coming from the spec.

0 commit comments

Comments
 (0)