Skip to content

Commit

Permalink
Bootstrap: Only exit when bootstrap has succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Nov 6, 2015
1 parent aaba84d commit 17a4376
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion cmd/kube-bootstrap/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ package app
import (
"k8s.io/kubernetes/pkg/bootstrap"

"github.com/golang/glog"
"github.com/spf13/pflag"
"time"
)

// BootstrapServerConfig contains configures and runs a Kubernetes proxy server
Expand Down Expand Up @@ -59,6 +61,15 @@ func NewBootstrapServerDefault(config *BootstrapServerConfig) (*BootstrapServer,
}

// Run runs the specified BootstrapServer, which bootstraps the machine.
// If it encounters an error, it will sleep and retry.
// Thus on exit the bootstrap has succeeded.
func (s *BootstrapServer) Run(_ []string) error {
return s.Bootstrapper.RunOnce()
for {
err := s.Bootstrapper.RunOnce()
if err == nil {
return nil
}
glog.Warning("error during bootstrapping (will sleep and retry): %v", err)
time.Sleep(10 * time.Second)
}
}
2 changes: 1 addition & 1 deletion pkg/bootstrap/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (b *Bootstrapper) mountMasterVolume() error {
if err != nil {
return fmt.Errorf("error creating directory %q: %v", target, err)
}

fsType := "ext4"
options := []string{"noatime"}
err = diskMounter.Mount(device, target, fsType, options)
Expand Down

1 comment on commit 17a4376

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 3884 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 197 Build time: 00:04:17

Please sign in to comment.