Skip to content

Commit

Permalink
Retry networking check for 10 seconds instead of just twice
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Jan 24, 2024
1 parent 51a07a3 commit a3d4d80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion phase/install_controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func (p *InstallControllers) Run() error {
err := p.parallelDo(p.hosts, func(h *cluster.Host) error {
if p.IsWet() || !p.leader.Metadata.DryRunFakeLeader {
log.Infof("%s: validating api connection to %s", h, url)
if err := retry.Times(context.Background(), 2, node.HTTPStatusFunc(h, healthz, 200, 401)); err != nil {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if err := retry.Context(ctx, node.HTTPStatusFunc(h, healthz, 200, 401)); err != nil {
return fmt.Errorf("failed to connect from controller to kubernetes api at %s - check networking", url)
}
} else {
Expand Down
4 changes: 3 additions & 1 deletion phase/install_workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func (p *InstallWorkers) Run() error {
err := p.parallelDo(p.hosts, func(h *cluster.Host) error {
if p.IsWet() || !p.leader.Metadata.DryRunFakeLeader {
log.Infof("%s: validating api connection to %s", h, url)
if err := retry.Times(context.Background(), 2, node.HTTPStatusFunc(h, healthz, 200, 401)); err != nil {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
if err := retry.Context(ctx, node.HTTPStatusFunc(h, healthz, 200, 401)); err != nil {
return fmt.Errorf("failed to connect from worker to kubernetes api at %s - check networking", url)
}
} else {
Expand Down

0 comments on commit a3d4d80

Please sign in to comment.