Skip to content

Commit ef883f8

Browse files
committed
baremetal: always write masters file
Even if some masters didn't finish provisioning and we had to exit due to context cancel, we should still write the state to disk.
1 parent d29e3b9 commit ef883f8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/utils/baremetal/bootstrap.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func WaitForBaremetalBootstrapControlPlane(ctx context.Context, config *rest.Con
3737

3838
masters := map[string]baremetalhost.BareMetalHost{}
3939

40-
_, err = clientwatch.UntilWithSync(
40+
_, withSyncErr := clientwatch.UntilWithSync(
4141
ctx,
4242
blw,
4343
&unstructured.Unstructured{},
@@ -96,10 +96,6 @@ func WaitForBaremetalBootstrapControlPlane(ctx context.Context, config *rest.Con
9696
},
9797
)
9898

99-
if err != nil {
100-
return err
101-
}
102-
10399
mastersJSON, err := json.Marshal(masters)
104100
if err != nil {
105101
return fmt.Errorf("failed to marshal masters: %w", err)
@@ -110,5 +106,5 @@ func WaitForBaremetalBootstrapControlPlane(ctx context.Context, config *rest.Con
110106
return fmt.Errorf("failed to persist masters file to disk: %w", err)
111107
}
112108

113-
return nil
109+
return withSyncErr
114110
}

0 commit comments

Comments
 (0)