Skip to content

Commit

Permalink
readyz?
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Dec 3, 2024
1 parent 9c76c97 commit 1aae0d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions phase/install_controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ func (p *InstallControllers) Run() error {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
err := retry.Context(ctx, func(_ context.Context) error {
out, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "get --raw='/healthz'"), exec.Sudo(h), exec.StreamOutput(), exec.Stdin(string(h.Metadata.K0sTokenData.Kubeconfig)))
out, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "get --raw='/readyz'"), exec.Sudo(h), exec.StreamOutput(), exec.Stdin(string(h.Metadata.K0sTokenData.Kubeconfig)))
if out != "ok" {
return fmt.Errorf("kubernetes api /healthz responded with %q", out)
return fmt.Errorf("kubernetes api /readyz responded with %q", out)
}
if err != nil {
return fmt.Errorf("failed to connect from controller to kubernetes api - check networking: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions phase/install_workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ func (p *InstallWorkers) Run() error {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
err := retry.Context(ctx, func(_ context.Context) error {
out, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "get --raw='/healthz'"), exec.Sudo(h), exec.StreamOutput(), exec.Stdin(string(h.Metadata.K0sTokenData.Kubeconfig)))
out, err := h.ExecOutput(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "get --raw='/readyz'"), exec.Sudo(h), exec.StreamOutput(), exec.Stdin(string(h.Metadata.K0sTokenData.Kubeconfig)))
if out != "ok" {
return fmt.Errorf("kubernetes api /healthz responded with %q", out)
return fmt.Errorf("kubernetes api /readyz responded with %q", out)
}
if err != nil {
return fmt.Errorf("failed to connect from controller to kubernetes api - check networking: %w", err)
Expand Down

0 comments on commit 1aae0d5

Please sign in to comment.