feat(cli): --host-key-fingerprint flag on node join (T02.3, REQ-058)
---ci--- project: orca phase: 2 milestone: v0.8 status: execute ---/ci---
This commit is contained in:
+17
-12
@@ -45,18 +45,19 @@ func nodeRegistry() (*engine.NodeRegistry, func() error, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
joinName string
|
joinName string
|
||||||
joinAddr string
|
joinAddr string
|
||||||
joinCAFinger string
|
joinCAFinger string
|
||||||
joinType string
|
joinType string
|
||||||
joinHost string
|
joinHost string
|
||||||
joinSSHUser string
|
joinSSHUser string
|
||||||
joinPassword string
|
joinPassword string
|
||||||
joinSSHPort int
|
joinSSHPort int
|
||||||
proxmoxUser string
|
joinHostKeyFP string
|
||||||
proxmoxRole string
|
proxmoxUser string
|
||||||
leaveID string
|
proxmoxRole string
|
||||||
nodeWatch bool
|
leaveID string
|
||||||
|
nodeWatch bool
|
||||||
)
|
)
|
||||||
|
|
||||||
var nodeCmd = &cobra.Command{
|
var nodeCmd = &cobra.Command{
|
||||||
@@ -76,6 +77,9 @@ Node types (via --type):
|
|||||||
(deploys orca pubkey, creates orca user + PVE role +
|
(deploys orca pubkey, creates orca user + PVE role +
|
||||||
sudoers allowlist; requires --host + --password)`,
|
sudoers allowlist; requires --host + --password)`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if joinHostKeyFP != "" && joinType != "proxmox" {
|
||||||
|
return fmt.Errorf("--host-key-fingerprint requires --type proxmox today")
|
||||||
|
}
|
||||||
if joinType == "proxmox" {
|
if joinType == "proxmox" {
|
||||||
return joinProxmox(cmd)
|
return joinProxmox(cmd)
|
||||||
}
|
}
|
||||||
@@ -352,6 +356,7 @@ func init() {
|
|||||||
nodeJoinCmd.Flags().IntVar(&joinSSHPort, "ssh-port", 22, "SSH port for proxmox bootstrap (default 22)")
|
nodeJoinCmd.Flags().IntVar(&joinSSHPort, "ssh-port", 22, "SSH port for proxmox bootstrap (default 22)")
|
||||||
nodeJoinCmd.Flags().StringVar(&proxmoxUser, "proxmox-user", "orca", "Linux system user to create on the proxmox host (config-overridable)")
|
nodeJoinCmd.Flags().StringVar(&proxmoxUser, "proxmox-user", "orca", "Linux system user to create on the proxmox host (config-overridable)")
|
||||||
nodeJoinCmd.Flags().StringVar(&proxmoxRole, "proxmox-role", "OrcaOperator", "PVE custom role to create (config-overridable)")
|
nodeJoinCmd.Flags().StringVar(&proxmoxRole, "proxmox-role", "OrcaOperator", "PVE custom role to create (config-overridable)")
|
||||||
|
nodeJoinCmd.Flags().StringVar(&joinHostKeyFP, "host-key-fingerprint", "", "SSH host key SHA256:base64 fingerprint (pre-pin; supersedes TOFU for --type proxmox)")
|
||||||
nodeLeaveCmd.Flags().StringVar(&leaveID, "id", "", "node id")
|
nodeLeaveCmd.Flags().StringVar(&leaveID, "id", "", "node id")
|
||||||
nodeListCmd.Flags().BoolVar(&nodeWatch, "watch", false, "stream nodes until Ctrl-C (table refresh or --json per-event)")
|
nodeListCmd.Flags().BoolVar(&nodeWatch, "watch", false, "stream nodes until Ctrl-C (table refresh or --json per-event)")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user