mirror of https://github.com/kubernetes/kops.git
Merge pull request #3933 from justinsb/lazy_ssh_keystore
Automatic merge from submit-queue. SSH keys - be lazier about keystore creation
This commit is contained in:
commit
bfd747a873
|
@ -1054,20 +1054,22 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, data := range sshPublicKeys {
|
if len(sshPublicKeys) != 0 {
|
||||||
err = keyStore.AddSSHPublicKey(k, data)
|
keyStore, err := clientset.KeyStore(cluster)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error adding SSH public key: %v", err)
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for k, data := range sshPublicKeys {
|
||||||
|
err = keyStore.AddSSHPublicKey(k, data)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error adding SSH public key: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue