cli, etcd, lib: Fixup golint issues with SSH

This stuff is arbitrary and stupid.
This commit is contained in:
James Shubin
2025-04-05 12:44:56 -04:00
parent f6a8404f9f
commit fce250b8af
3 changed files with 16 additions and 16 deletions

View File

@@ -54,14 +54,14 @@ import (
// particular one contains all the common flags for the `deploy` subcommand
// which all frontends can use.
type DeployArgs struct {
// SshUrl can be specified if we want to transport the SSH client
// SSHURL can be specified if we want to transport the SSH client
// connection over SSH. If this is specified, the second hop is made
// with the Seeds values, but they connect from this destination. You
// can specify this in the standard james@server:22 format. This will
// use your ~/.ssh/ directory for public key authentication and
// verifying the host key in the known_hosts file. This must already be
// setup for things to work.
SshUrl string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"`
SSHURL string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"`
Seeds []string `arg:"--seeds,env:MGMT_SEEDS" help:"default etcd client endpoints"`
Noop bool `arg:"--noop" help:"globally force all resources into no-op mode"`
@@ -208,9 +208,9 @@ func (obj *DeployArgs) Run(ctx context.Context, data *cliUtil.Data) (bool, error
//GetURI: func() string {
//},
}
if obj.SshUrl != "" { // alternate world implementation over SSH
if obj.SSHURL != "" { // alternate world implementation over SSH
world = &etcdSSH.World{
URL: obj.SshUrl,
URL: obj.SSHURL,
Seeds: obj.Seeds,
NS: lib.NS,
//MetadataPrefix: lib.MetadataPrefix,

View File

@@ -54,7 +54,7 @@ import (
const (
defaultUser = "root"
defaultSshPort uint16 = 22
defaultSSHPort uint16 = 22
defaultEtcdPort uint16 = 2379 // TODO: get this from etcd pkg
defaultIDRsaPath = "~/.ssh/id_rsa"
defaultIDEd25519Path = "~/.ssh/id_ed25519"
@@ -68,12 +68,12 @@ type World struct {
// ip's should be relative to this server.
URL string
// SshID is the path to the ~/.ssh/id_rsa or ~/.ssh/id_ed25519 to use
// SSHID is the path to the ~/.ssh/id_rsa or ~/.ssh/id_ed25519 to use
// for auth. If you omit this then this will look for your private key
// in both of those default paths. If you specific a specific path, then
// that will only be used. This will expand the ~/ and ~user/ style path
// expansions.
SshID string
SSHID string
// Seeds are the list of etcd endpoints to connect to.
Seeds []string
@@ -161,7 +161,7 @@ func (obj *World) Init(init *engine.WorldInit) error {
if hostname == "" {
return fmt.Errorf("empty hostname")
}
port := strconv.Itoa(int(defaultSshPort)) // default
port := strconv.Itoa(int(defaultSSHPort)) // default
if s := u.Port(); s != "" {
port = s
}
@@ -193,7 +193,7 @@ func (obj *World) Init(init *engine.WorldInit) error {
if hostname == "" {
return fmt.Errorf("empty hostname")
}
port := strconv.Itoa(int(defaultSshPort)) // default
port := strconv.Itoa(int(defaultSSHPort)) // default
if s := u.Port(); s != "" {
port = s
}
@@ -203,13 +203,13 @@ func (obj *World) Init(init *engine.WorldInit) error {
auths := []ssh.AuthMethod{}
//auths = append(auths, ssh.Password("password")) // testing
choices := []string{
//obj.SshID,
//obj.SSHID,
defaultIDEd25519Path,
defaultIDRsaPath, // "~/.ssh/id_rsa"
}
if obj.SshID != "" {
if obj.SSHID != "" {
choices = []string{
obj.SshID,
obj.SSHID,
}
}
for _, p := range choices {

View File

@@ -148,14 +148,14 @@ type Config struct {
// this many seconds. Use 0 to disable this.
MaxRuntime uint `arg:"--max-runtime,env:MGMT_MAX_RUNTIME" help:"exit after a maximum of approximately this many seconds"`
// SshUrl can be specified if we want to transport the SSH client
// SSHURL can be specified if we want to transport the SSH client
// connection over SSH. If this is specified, the second hop is made
// with the Seeds values, but they connect from this destination. You
// can specify this in the standard james@server:22 format. This will
// use your ~/.ssh/ directory for public key authentication and
// verifying the host key in the known_hosts file. This must already be
// setup for things to work.
SshUrl string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"`
SSHURL string `arg:"--ssh-url" help:"transport the etcd client connection over SSH to this server"`
// Seeds are the list of default etcd client endpoints. If empty, it
// will startup a new server.
@@ -617,9 +617,9 @@ func (obj *Main) Run() error {
return gapiInfoResult.URI
},
}
if obj.SshUrl != "" { // alternate world implementation over SSH
if obj.SSHURL != "" { // alternate world implementation over SSH
world = &etcdSSH.World{
URL: obj.SshUrl,
URL: obj.SSHURL,
Seeds: obj.Seeds,
NS: NS,
MetadataPrefix: MetadataPrefix,