Skip to content

Commit

Permalink
update bootstrap logic (k3s-io#4438)
Browse files Browse the repository at this point in the history
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
  • Loading branch information
briandowns committed Nov 10, 2021
1 parent 50d4d41 commit 0b30282
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 92 deletions.
4 changes: 3 additions & 1 deletion pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/pkg/errors"
"github.com/rancher/k3s/pkg/daemons/config"
"github.com/sirupsen/logrus"
)

func Handler(bootstrap *config.ControlRuntimeBootstrap) http.Handler {
Expand All @@ -35,7 +36,8 @@ func ReadFromDisk(w io.Writer, bootstrap *config.ControlRuntimeBootstrap) error
}
data, err := ioutil.ReadFile(path)
if err != nil {
return errors.Wrapf(err, "failed to read %s", path)
logrus.Warnf("failed to read %s", path)
continue
}

info, err := os.Stat(path)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/etcdsnapshot/etcd_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func run(app *cli.Context, cfg *cmds.Server) error {

cluster := cluster.New(&serverConfig.ControlConfig)

if err := cluster.Bootstrap(ctx); err != nil {
if err := cluster.Bootstrap(ctx, true); err != nil {
return err
}

Expand Down
Loading

0 comments on commit 0b30282

Please sign in to comment.