Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cloudprofilesync/k8ssync/source/landscape/landscape_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down
8 changes: 4 additions & 4 deletions cloudprofilesync/ossync/os_image_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions cloudprofilesync/ossync/os_image_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
}},
},
Expand Down
1 change: 0 additions & 1 deletion cloudprofilesync/ossync/source/glance/os_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
16 changes: 13 additions & 3 deletions controllers/cloud_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)),
})
Comment thread
anton-paulovich marked this conversation as resolved.
if statusErr != nil {
return fmt.Errorf("failed to patch ManagedCloudProfile status: %w", statusErr)
Expand Down Expand Up @@ -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
}
Comment thread
anton-paulovich marked this conversation as resolved.