Skip to content

Commit

Permalink
Set current user as default when running DryRun for SSH provider
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
  • Loading branch information
ArangoGutierrez committed Feb 2, 2024
1 parent ce9f741 commit 86c038e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/dryrun/dryrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func (m command) run(c *cli.Context, opts *options) error {
return err
}
case v1alpha1.ProviderSSH:
// if username is not provided, use the current user
if opts.cfg.Spec.Username == "" {
opts.cfg.Spec.Username = os.Getenv("USER")
}
if err := connectOrDie(opts.cfg.Spec.Auth.PrivateKey, opts.cfg.Spec.Username, opts.cfg.Spec.Instance.HostUrl); err != nil {
return err
}
Expand Down

0 comments on commit 86c038e

Please sign in to comment.