diff --git a/Dockerfile b/Dockerfile index ef67192..ad97555 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # Build the manager binary -FROM golang:1.26-alpine AS builder +FROM golang:1.27-alpine AS builder WORKDIR /workspace ENV GOTOOLCHAIN=local diff --git a/cloudprofilesync/k8ssync/source/landscape/landscape_source.go b/cloudprofilesync/k8ssync/source/landscape/landscape_source.go index 6cb6656..1708756 100644 --- a/cloudprofilesync/k8ssync/source/landscape/landscape_source.go +++ b/cloudprofilesync/k8ssync/source/landscape/landscape_source.go @@ -338,8 +338,8 @@ func parseProviderVersions(raw []byte, provider string) ([]gardenerv1beta1.Expir for _, v := range p.Versions { result = append(result, gardenerv1beta1.ExpirableVersion{ Version: v.Version, - Classification: v.Classification, - ExpirationDate: convertExpirationDate(v.ExpirationDate), + Classification: v.Classification, //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate + ExpirationDate: convertExpirationDate(v.ExpirationDate), //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate }) } diff --git a/cloudprofilesync/ossync/os_image_updater.go b/cloudprofilesync/ossync/os_image_updater.go index 498f979..cd9dc90 100644 --- a/cloudprofilesync/ossync/os_image_updater.go +++ b/cloudprofilesync/ossync/os_image_updater.go @@ -205,8 +205,8 @@ func (iu *ImageUpdater) Update(ctx context.Context, cpSpec *gardenerv1beta1.Clou image.Versions = append(image.Versions, gardenerv1beta1.MachineImageVersion{ ExpirableVersion: gardenerv1beta1.ExpirableVersion{ Version: sourceImage.Version, - Classification: sourceImage.Classification, - ExpirationDate: iu.resolveExpiration(sourceImage, nil), + Classification: sourceImage.Classification, //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate + ExpirationDate: iu.resolveExpiration(sourceImage, nil), //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate }, Architectures: sourceImage.Architectures, }) @@ -238,8 +238,8 @@ func (iu *ImageUpdater) Update(ctx context.Context, cpSpec *gardenerv1beta1.Clou v := gardenerv1beta1.MachineImageVersion{ ExpirableVersion: gardenerv1beta1.ExpirableVersion{ Version: sourceImage.CleanVersion, - Classification: sourceImage.Classification, - ExpirationDate: iu.resolveExpiration(sourceImage, nil), + Classification: sourceImage.Classification, //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate + ExpirationDate: iu.resolveExpiration(sourceImage, nil), //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate }, Architectures: slices.Clone(sourceImage.Architectures), CapabilityFlavors: mergeCapabilityFlavor(nil, sourceImage.Capabilities), diff --git a/cloudprofilesync/ossync/os_image_updater_test.go b/cloudprofilesync/ossync/os_image_updater_test.go index 3db6be3..d78084d 100644 --- a/cloudprofilesync/ossync/os_image_updater_test.go +++ b/cloudprofilesync/ossync/os_image_updater_test.go @@ -545,8 +545,8 @@ var _ = Describe("ImageUpdater", func() { {Name: "test", Versions: []gardencorev1beta1.MachineImageVersion{ {ExpirableVersion: gardencorev1beta1.ExpirableVersion{ Version: "1.0.0", - Classification: &deprecated, - ExpirationDate: &existing, + Classification: &deprecated, //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate + ExpirationDate: &existing, //nolint:staticcheck // legacy fields; Lifecycle needs the VersionClassificationLifecycle feature gate }, Architectures: []string{"amd64"}}, }}, }, diff --git a/cloudprofilesync/ossync/source/glance/os_source.go b/cloudprofilesync/ossync/source/glance/os_source.go index f7d8bd2..80fb283 100644 --- a/cloudprofilesync/ossync/source/glance/os_source.go +++ b/cloudprofilesync/ossync/source/glance/os_source.go @@ -290,7 +290,6 @@ func compareSemverDesc(a, b string) int { // parseVersion extracts the semver version from a matching image name. func (g *Glance) parseVersion(name string) (string, bool) { if strings.Contains(name, usiVariantMarker) { - g.log.V(1).Info("skipping usi image variant", "name", name) return "", false } diff --git a/controllers/cloud_profile.go b/controllers/cloud_profile.go index 2e5a1e3..564adb0 100644 --- a/controllers/cloud_profile.go +++ b/controllers/cloud_profile.go @@ -45,13 +45,13 @@ func (r *Reconciler) reconcileCloudProfile(ctx context.Context, log logr.Logger, cloudProfile.Spec = CloudProfileSpecToGardener(&mcp.Spec.CloudProfile) errs := make([]error, 0) for _, updates := range mcp.Spec.MachineImageUpdates { - log.Info("updating machine images", "cloudProfile", cloudProfile.Name) + log.V(1).Info("updating machine images", "cloudProfile", cloudProfile.Name) if updateErr := r.updateMachineImages(ctx, log, updates, &cloudProfile.Spec); updateErr != nil { errs = append(errs, updateErr) } } if mcp.Spec.KubernetesVersionUpdateConfig != nil { - log.Info("updating kubernetes versions", "cloudProfile", cloudProfile.Name) + log.V(1).Info("updating kubernetes versions", "cloudProfile", cloudProfile.Name) if updateErr := r.updateKubernetesVersions(ctx, *mcp.Spec.KubernetesVersionUpdateConfig, &cloudProfile.Spec); updateErr != nil { errs = append(errs, updateErr) } @@ -65,7 +65,7 @@ func (r *Reconciler) reconcileCloudProfile(ctx context.Context, log logr.Logger, Status: metav1.ConditionFalse, ObservedGeneration: mcp.Generation, Reason: "ApplyFailed", - Message: fmt.Sprintf("Failed to apply CloudProfile: %s", err), + Message: truncateConditionMessage(fmt.Sprintf("Failed to apply CloudProfile: %s", err)), }) if statusErr != nil { return fmt.Errorf("failed to patch ManagedCloudProfile status: %w", statusErr) @@ -254,3 +254,13 @@ func (r *Reconciler) landscapeSetupSource(ctx context.Context, ls v1alpha1.Lands return landscapeSource, nil } + +const maxConditionMessageLen = 32768 + +func truncateConditionMessage(msg string) string { + if len(msg) <= maxConditionMessageLen { + return msg + } + const suffix = "...[truncated]" + return msg[:maxConditionMessageLen-len(suffix)] + suffix +}