Skip to content

Commit

Permalink
add info message when using context keys
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Jan 11, 2024
1 parent 5dd956c commit fae2354
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/cmd/server/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ func createOptsFromFlags(

// check if ssh-key flag was set, otherwise set to defaults
if !flags.Changed("ssh-key") {
if ctx := s.Config().ActiveContext(); ctx != nil {
if ctx := s.Config().ActiveContext(); ctx != nil && len(ctx.SSHKeys) > 0 {
cmd.Println("Using SSH key(s) from active context")
sshKeys = ctx.SSHKeys
}
}
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/server/enable_rescue.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ var EnableRescueCmd = base.Cmd{

// check if ssh-key flag was set, otherwise set to defaults
if !cmd.Flags().Changed("ssh-key") {
if ctx := s.Config().ActiveContext(); ctx != nil {
if ctx := s.Config().ActiveContext(); ctx != nil && len(ctx.SSHKeys) > 0 {
cmd.Println("Using SSH key(s) from active context")
sshKeys = ctx.SSHKeys
}
}
Expand Down

0 comments on commit fae2354

Please sign in to comment.