builder/googlecompute: only load secrets/private key if given
This commit is contained in:
parent
501238b2bb
commit
a91b8f6853
@ -163,19 +163,23 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
|||||||
}
|
}
|
||||||
c.stateTimeout = stateTimeout
|
c.stateTimeout = stateTimeout
|
||||||
|
|
||||||
// Load the client secrets file.
|
if c.ClientSecretsFile != "" {
|
||||||
cs, err := loadClientSecrets(c.ClientSecretsFile)
|
// Load the client secrets file.
|
||||||
if err != nil {
|
cs, err := loadClientSecrets(c.ClientSecretsFile)
|
||||||
errs = packer.MultiErrorAppend(
|
if err != nil {
|
||||||
errs, fmt.Errorf("Failed parsing client secrets file: %s", err))
|
errs = packer.MultiErrorAppend(
|
||||||
|
errs, fmt.Errorf("Failed parsing client secrets file: %s", err))
|
||||||
|
}
|
||||||
|
c.clientSecrets = cs
|
||||||
}
|
}
|
||||||
c.clientSecrets = cs
|
|
||||||
|
|
||||||
// Load the private key.
|
if c.PrivateKeyFile != "" {
|
||||||
c.privateKeyBytes, err = processPrivateKeyFile(c.PrivateKeyFile, c.Passphrase)
|
// Load the private key.
|
||||||
if err != nil {
|
c.privateKeyBytes, err = processPrivateKeyFile(c.PrivateKeyFile, c.Passphrase)
|
||||||
errs = packer.MultiErrorAppend(
|
if err != nil {
|
||||||
errs, fmt.Errorf("Failed loading private key file: %s", err))
|
errs = packer.MultiErrorAppend(
|
||||||
|
errs, fmt.Errorf("Failed loading private key file: %s", err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for any errors.
|
// Check for any errors.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user