mirror of https://github.com/kubernetes/kops.git
Fix swallowed errors in upup subdirectory.
This commit is contained in:
parent
39ef6433a2
commit
6cf856d972
|
|
@ -108,6 +108,9 @@ func parseSSHPublicKey(publicKey string) (ssh.PublicKey, error) {
|
|||
}
|
||||
|
||||
sshPublicKeyBytes, err := base64.StdEncoding.DecodeString(tokens[1])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error decoding SSH public key: %q err: %s", publicKey, err)
|
||||
}
|
||||
if len(tokens) < 2 {
|
||||
return nil, fmt.Errorf("error decoding SSH public key: %q", publicKey)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,11 +92,18 @@ func (_ *AttachISO) CheckChanges(a, e, changes *AttachISO) error {
|
|||
// RenderVSphere executes the actual task logic, for vSphere cloud.
|
||||
func (_ *AttachISO) RenderVSphere(t *vsphere.VSphereAPITarget, a, e, changes *AttachISO) error {
|
||||
startupScript, err := changes.BootstrapScript.ResourceNodeUp(changes.IG)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
startupStr, err := startupScript.AsString()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error rendering startup script: %v", err)
|
||||
}
|
||||
dir, err := ioutil.TempDir("", *changes.VM.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
// Need this in cloud config file for vSphere CloudProvider
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ func (c *KubernetesKeystore) StoreKeypair(id string, cert *fi.Certificate, priva
|
|||
}
|
||||
|
||||
secret, err := keypair.Encode()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error encoding keypair: %+v err: %s", keypair, err)
|
||||
}
|
||||
createdSecret, err := c.client.CoreV1().Secrets(c.namespace).Create(secret)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating secret %s/%s: %v", secret.Namespace, secret.Name, err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue