Skip to content

Commit 5cfb1cd

Browse files
authored
Mark ServerBootConfig as Error when image retrieval fails (#142)
1 parent a04a088 commit 5cfb1cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/controller/serverbootconfiguration_pxe_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ func (r *ServerBootConfigurationPXEReconciler) reconcile(ctx context.Context, lo
102102

103103
kernelURL, initrdURL, squashFSURL, err := r.getImageDetailsFromConfig(ctx, config)
104104
if err != nil {
105+
if err := r.patchState(ctx, config, metalv1alpha1.ServerBootConfigurationStateError); err != nil {
106+
return ctrl.Result{}, fmt.Errorf("failed to patch server boot config state to %s: %w", metalv1alpha1.ServerBootConfigurationStateError, err)
107+
}
105108
return ctrl.Result{}, fmt.Errorf("failed to get image details from BootConfig: %w", err)
106109
}
107110
log.V(1).Info("Extracted OS image layer details")

0 commit comments

Comments
 (0)