Skip to content

Commit

Permalink
Merge pull request #7 from NVIDIA/sshUser
Browse files Browse the repository at this point in the history
Set current user as default when running DryRun for SSH provider
  • Loading branch information
ArangoGutierrez authored Feb 2, 2024
2 parents 85fc4dd + 86c038e commit 3eead57
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 3eead57

Please sign in to comment.