diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 87da7f48b..69b6df697 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,4 +1,4 @@ -FROM registry.suse.com/bci/golang:1.22 +FROM registry.suse.com/bci/golang:1.23 ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH @@ -11,7 +11,7 @@ RUN zypper -n install git docker vim less file curl wget awk RUN curl -sL https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz | tar xvzf - -C /usr/local/bin --strip-components=1 RUN if [ "${ARCH}" = "amd64" ]; then \ - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1; \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.63.4; \ helm plugin install https://github.com/helm-unittest/helm-unittest.git --version ${HELM_UNITTEST_VERSION}>/out.txt 2>&1; \ fi diff --git a/go.mod b/go.mod index 95d138b1f..1e3209d84 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/rancher/webhook -go 1.22.0 +go 1.23.0 -toolchain go1.22.7 +toolchain go1.23.4 replace ( github.com/rancher/rke => github.com/rancher/rke v1.6.2 diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index b30fe58bc..4602a85b2 100644 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -1,3 +1,8 @@ +// Turn off creation of Alias types, which break code generation. +// This can be removed after migrating to k8s 1.32 code generators that are aware of the new type. +// For more details see https://github.com/rancher/rancher/issues/47207 +//go:debug gotypesalias=0 + package main import ( diff --git a/pkg/resources/common/psa-validation.go b/pkg/resources/common/psa-validation.go index 560e4a847..9cd77710f 100644 --- a/pkg/resources/common/psa-validation.go +++ b/pkg/resources/common/psa-validation.go @@ -23,9 +23,9 @@ var psaLabels = []string{ // IsUpdatingPSAConfig will indicate whether or not the labels being passed in // are attempting to update PSA-related configuration. -func IsUpdatingPSAConfig(old map[string]string, new map[string]string) bool { +func IsUpdatingPSAConfig(oldLabels map[string]string, newLabels map[string]string) bool { for _, label := range psaLabels { - if old[label] != new[label] { + if oldLabels[label] != newLabels[label] { return true } } @@ -34,8 +34,8 @@ func IsUpdatingPSAConfig(old map[string]string, new map[string]string) bool { // IsCreatingPSAConfig will indicate whether or not the labels being passed in // are attempting to create PSA-related configuration. -func IsCreatingPSAConfig(new map[string]string) bool { - for label := range new { +func IsCreatingPSAConfig(newLabels map[string]string) bool { + for label := range newLabels { if slices.Contains(psaLabels, label) { return true } diff --git a/pkg/resources/management.cattle.io/v3/feature/validator.go b/pkg/resources/management.cattle.io/v3/feature/validator.go index 701f7bb51..501275cac 100644 --- a/pkg/resources/management.cattle.io/v3/feature/validator.go +++ b/pkg/resources/management.cattle.io/v3/feature/validator.go @@ -88,20 +88,20 @@ func (a *admitter) Admit(request *admission.Request) (*admissionv1.AdmissionResp // isUpdateAllowed checks that the new value does not change on spec unless it's equal to the lockedValue, // or lockedValue is nil. -func isUpdateAllowed(old, new *v3.Feature) bool { - if old == nil || new == nil { +func isUpdateAllowed(oldFeature, newFeature *v3.Feature) bool { + if oldFeature == nil || newFeature == nil { return false } - if new.Status.LockedValue == nil { + if newFeature.Status.LockedValue == nil { return true } - if old.Spec.Value == nil && new.Spec.Value == nil { + if oldFeature.Spec.Value == nil && newFeature.Spec.Value == nil { return true } - if old.Spec.Value != nil && new.Spec.Value != nil && *old.Spec.Value == *new.Spec.Value { + if oldFeature.Spec.Value != nil && newFeature.Spec.Value != nil && *oldFeature.Spec.Value == *newFeature.Spec.Value { return true } - if new.Spec.Value != nil && *new.Spec.Value == *new.Status.LockedValue { + if newFeature.Spec.Value != nil && *newFeature.Spec.Value == *newFeature.Status.LockedValue { return true } return false