Skip to content

Commit

Permalink
Apply PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Jun 10, 2024
1 parent e7e6931 commit 239b780
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/k8s/cmd/k8s/k8s_x_wait_for.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func newXWaitForCmd(env cmdutil.ExecutionEnvironment) *cobra.Command {
defer cancel()
if err := control.WaitUntilReady(ctx, func() (bool, error) {
err := features.StatusChecks.CheckDNS(cmd.Context(), env.Snap)
if err != nil {
cmd.PrintErrf("DNS not ready yet: %v\n", err.Error())
}
return err == nil, nil
}); err != nil {
cmd.PrintErrf("Error: DNS did not become ready: %v\n", err)
Expand All @@ -39,6 +42,9 @@ func newXWaitForCmd(env cmdutil.ExecutionEnvironment) *cobra.Command {
defer cancel()
if err := control.WaitUntilReady(ctx, func() (bool, error) {
err := features.StatusChecks.CheckNetwork(cmd.Context(), env.Snap)
if err != nil {
cmd.PrintErrf("network not ready yet: %v\n", err.Error())
}
return err == nil, nil
}); err != nil {
cmd.PrintErrf("Error: network did not become ready: %v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion src/k8s/pkg/k8sd/features/calico/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func CheckNetwork(ctx context.Context, snap snap.Snap) error {
if err := client.CheckForReadyPods(ctx, check.namespace, metav1.ListOptions{
LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{MatchLabels: check.labels}),
}); err != nil {
return fmt.Errorf("check %v failed: %w", check.name, err)
return fmt.Errorf("%v pods not yet ready: %w", check.name, err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/k8s/pkg/k8sd/features/cilium/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func CheckNetwork(ctx context.Context, snap snap.Snap) error {
if err := client.CheckForReadyPods(ctx, check.namespace, metav1.ListOptions{
LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{MatchLabels: check.labels}),
}); err != nil {
return fmt.Errorf("check %v failed: %w", check.name, err)
return fmt.Errorf("%v pods not yet ready: %w", check.name, err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/k8s/pkg/k8sd/features/coredns/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func CheckDNS(ctx context.Context, snap snap.Snap) error {
if err := client.CheckForReadyPods(ctx, check.namespace, metav1.ListOptions{
LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{MatchLabels: check.labels}),
}); err != nil {
return fmt.Errorf("check %v failed: %w", check.name, err)
return fmt.Errorf("%v pods not yet ready: %w", check.name, err)
}
}

Expand Down

0 comments on commit 239b780

Please sign in to comment.