Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ ingress:
ValidArgsFunction: c.comp.FirewallListCompletion,
}
firewallSSHCmd.Flags().StringP("identity", "i", "~/.ssh/id_rsa", "specify identity file to SSH to the firewall like: -i path/to/id_rsa")
firewallSSHCmd.Flags().String("reason", "", "the reason why to connect to the firewall through SSH")
return genericcli.NewCmds(cmdsConfig, firewallSSHCmd)
}

Expand Down
2 changes: 2 additions & 0 deletions cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/metal-stack/metal-go/api/client/vpn"
"github.com/metal-stack/metal-go/api/models"
"github.com/metal-stack/metal-lib/pkg/pointer"
metalssh "github.com/metal-stack/metal-lib/pkg/ssh"
metalvpn "github.com/metal-stack/metal-lib/pkg/vpn"
"github.com/spf13/viper"
Expand All @@ -23,6 +24,7 @@ func (c *firewallCmd) firewallSSHViaVPN(firewall *models.V1FirewallResponse) (er
authKeyResp, err := c.client.VPN().GetVPNAuthKey(vpn.NewGetVPNAuthKeyParams().WithBody(&models.V1VPNRequest{
Pid: projectID,
Ephemeral: new(true),
Reason: pointer.PointerOrNil(viper.GetString("reason")),
}), nil)
if err != nil {
return fmt.Errorf("failed to get VPN auth key: %w", err)
Expand Down
1 change: 1 addition & 0 deletions docs/metalctl_firewall_ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ metalctl firewall ssh <firewall ID> [flags]
```
-h, --help help for ssh
-i, --identity string specify identity file to SSH to the firewall like: -i path/to/id_rsa (default "~/.ssh/id_rsa")
--reason string the reason why to connect to the firewall through SSH
```

### Options inherited from parent commands
Expand Down
Loading