From 56a6a21dde9409e2c620f0af9e33d21d319f0fb2 Mon Sep 17 00:00:00 2001 From: Kubermatic Bot <41968677+kubermatic-bot@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:45:48 +0300 Subject: [PATCH] fix(controller): handle error for invalid osp (#397) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Oliver Bähler Co-authored-by: Oliver Bähler --- pkg/controllers/osc/osc_controller.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/osc/osc_controller.go b/pkg/controllers/osc/osc_controller.go index 432d651b..8483d4f9 100644 --- a/pkg/controllers/osc/osc_controller.go +++ b/pkg/controllers/osc/osc_controller.go @@ -268,6 +268,9 @@ func (r *Reconciler) reconcileOperatingSystemConfigs(ctx context.Context, md *cl r.containerRuntimeConfig, r.kubeletFeatureGates, ) + if err != nil { + return fmt.Errorf("failed to generate %s osc: %w", oscName, err) + } if osc.Spec.CloudProvider.Name == "edge" { if err := r.generateEdgeScript(ctx, md, token, bootstrapKubeconfig); err != nil { @@ -275,10 +278,6 @@ func (r *Reconciler) reconcileOperatingSystemConfigs(ctx context.Context, md *cl } } - if err != nil { - return fmt.Errorf("failed to generate %s osc: %w", oscName, err) - } - // Add machine deployment revision to OSC revision := md.Annotations[machinecontrollerutil.RevisionAnnotation] osc.Annotations = addMachineDeploymentRevision(revision, osc.Annotations)