mirror of https://github.com/kubernetes/kops.git
SSH keys - be lazier about keystore creation
This commit is contained in:
parent
0a2f949fd9
commit
ad60069d71
|
@ -1054,22 +1054,24 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
|
||||||
return fmt.Errorf("error writing updated configuration: %v", err)
|
return fmt.Errorf("error writing updated configuration: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
keyStore, err := clientset.KeyStore(cluster)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = registry.WriteConfigDeprecated(cluster, configBase.Join(registry.PathClusterCompleted), fullCluster)
|
err = registry.WriteConfigDeprecated(cluster, configBase.Join(registry.PathClusterCompleted), fullCluster)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error writing completed cluster spec: %v", err)
|
return fmt.Errorf("error writing completed cluster spec: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(sshPublicKeys) != 0 {
|
||||||
|
keyStore, err := clientset.KeyStore(cluster)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
for k, data := range sshPublicKeys {
|
for k, data := range sshPublicKeys {
|
||||||
err = keyStore.AddSSHPublicKey(k, data)
|
err = keyStore.AddSSHPublicKey(k, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error adding SSH public key: %v", err)
|
return fmt.Errorf("error adding SSH public key: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Can we acutally get to this if??
|
// Can we acutally get to this if??
|
||||||
if targetName != "" {
|
if targetName != "" {
|
||||||
|
|
Loading…
Reference in New Issue