mirror of https://github.com/kubernetes/kops.git
Merge pull request #10676 from rifelpet/kubetest2-dump-user
kubetest2 - Use --ssh-user to dump logs
This commit is contained in:
commit
6fbc742141
|
|
@ -68,6 +68,9 @@ func (d *deployer) initialize() error {
|
||||||
if d.SSHPublicKeyPath == "" {
|
if d.SSHPublicKeyPath == "" {
|
||||||
d.SSHPublicKeyPath = os.Getenv("AWS_SSH_PUBLIC_KEY_FILE")
|
d.SSHPublicKeyPath = os.Getenv("AWS_SSH_PUBLIC_KEY_FILE")
|
||||||
}
|
}
|
||||||
|
if d.SSHUser == "" {
|
||||||
|
d.SSHUser = os.Getenv("KUBE_SSH_USER")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ type deployer struct {
|
||||||
|
|
||||||
KubernetesVersion string `flag:"kubernetes-version" desc:"The kubernetes version to use in the cluster"`
|
KubernetesVersion string `flag:"kubernetes-version" desc:"The kubernetes version to use in the cluster"`
|
||||||
|
|
||||||
SSHPrivateKeyPath string `flag:"ssh-private-key" desc:"The path to the private key used for SSH access to instances"`
|
SSHPrivateKeyPath string `flag:"ssh-private-key" desc:"The path to the private key used for SSH access to instances"`
|
||||||
SSHPublicKeyPath string `flag:"ssh-public-key" desc:"The path to the public key passed to the cloud provider"`
|
SSHPublicKeyPath string `flag:"ssh-public-key" desc:"The path to the public key passed to the cloud provider"`
|
||||||
SSHUser []string `flag:"ssh-user" desc:"The SSH users to use for SSH access to instances"`
|
SSHUser string `flag:"ssh-user" desc:"The SSH user to use for SSH access to instances"`
|
||||||
|
|
||||||
ArtifactsDir string `flag:"-"`
|
ArtifactsDir string `flag:"-"`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ func (d *deployer) DumpClusterLogs() error {
|
||||||
"--name", d.ClusterName,
|
"--name", d.ClusterName,
|
||||||
"--dir", d.ArtifactsDir,
|
"--dir", d.ArtifactsDir,
|
||||||
"--private-key", d.SSHPrivateKeyPath,
|
"--private-key", d.SSHPrivateKeyPath,
|
||||||
|
"--ssh-user", d.SSHUser,
|
||||||
}
|
}
|
||||||
klog.Info(strings.Join(args, " "))
|
klog.Info(strings.Join(args, " "))
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
cmd := exec.Command(args[0], args[1:]...)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue