Skip to content

Commit 1e4cb53

Browse files
Merge pull request #8365 from honza/write-masters-after-error
OCPBUGS-33370: baremetal: always write masters file
2 parents 785fd16 + ef883f8 commit 1e4cb53

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)