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)