Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 3f42b41

Browse files
author
Carolyn Van Slyck
committed
Allow cluster to boot even when an asset fails
1 parent 67aa97a commit 3f42b41

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

pkg/bootkube/create.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,17 @@ func CreateAssets(manifestDir string, timeout time.Duration) error {
3131

3232
createFn := func() (bool, error) {
3333
err := createAssets(manifestDir)
34-
return true, err
34+
if err != nil {
35+
err = fmt.Errorf("Error creating assets: %v", err)
36+
glog.Error(err)
37+
UserOutput("%v\n", err)
38+
UserOutput("\nNOTE: Bootkube failed to create some cluster assets. It is important that manifest errors are resolved and resubmitted to the apiserver.\n")
39+
UserOutput("For example, after resolving issues: kubectl create -f <failed-manifest>\n\n")
40+
}
41+
42+
// Do not fail cluster creation due to missing assets as it is a recoverable situation
43+
// See https://github.com/kubernetes-incubator/bootkube/pull/368/files#r105509074
44+
return true, nil
3545
}
3646

3747
UserOutput("Waiting for api-server...\n")
@@ -45,11 +55,8 @@ func CreateAssets(manifestDir string, timeout time.Duration) error {
4555
UserOutput("Creating self-hosted assets...\n")
4656
timeout = timeout - time.Since(start)
4757
if err := wait.PollImmediate(5*time.Second, timeout, createFn); err != nil {
48-
err = fmt.Errorf("Error creating assets: %v", err)
58+
err = fmt.Errorf("Failed to create assets: %v", err)
4959
glog.Error(err)
50-
UserOutput("%v\n", err)
51-
UserOutput("\nNOTE: Bootkube failed to create some cluster assets. It is important that manifest errors are resolved and resubmitted to the apiserver.\n")
52-
UserOutput("For example, after resolving issues: kubectl create -f <failed-manifest>\n\n")
5360
return err
5461
}
5562

0 commit comments

Comments
 (0)