Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: Add output flag #258

Merged
merged 10 commits into from
Mar 29, 2023
Prev Previous commit
Next Next commit
reduce unnecessary complexity
  • Loading branch information
petersutter committed Mar 29, 2023
commit 85c9cafd6490d0e7fcc1dc35791f33d422b784ac
9 changes: 2 additions & 7 deletions pkg/cmd/ssh/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,17 +665,12 @@ func (o *SSHOptions) Run(f util.Factory) error {
logger.Info("Waiting for bastion to be ready…", "waitTimeout", o.WaitTimeout)

err = waitForBastion(ctx, o, gardenClient.RuntimeClient(), bastion)

if err == wait.ErrWaitTimeout {
logger.Info("Timed out waiting for the bastion to be ready.")
return errors.New("timed out waiting for the bastion to be ready")
} else if err != nil {
logger.Error(err, "An error occurred while waiting for the bastion to be ready.")
return fmt.Errorf("an error occurred while waiting for the bastion to be ready: %w", err)
}

if err != nil {
// actual error has already been printed
return errors.New("precondition failed")
}

ingress := bastion.Status.Ingress
printAddr := ""
Expand Down