Added support for specifying Service Account in Google Compute exporter post-processor. (#8388)
This commit is contained in:
parent
cf6058b8fb
commit
e1cb0c5f7e
@ -30,6 +30,7 @@ type Config struct {
|
||||
Subnetwork string `mapstructure:"subnetwork"`
|
||||
VaultGCPOauthEngine string `mapstructure:"vault_gcp_oauth_engine"`
|
||||
Zone string `mapstructure:"zone"`
|
||||
ServiceAccountEmail string `mapstructure:"service_account_email"`
|
||||
|
||||
account *jwt.Config
|
||||
ctx interpolate.Context
|
||||
@ -150,6 +151,9 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact
|
||||
"https://www.googleapis.com/auth/userinfo.email",
|
||||
},
|
||||
}
|
||||
if p.config.ServiceAccountEmail != "" {
|
||||
exporterConfig.ServiceAccountEmail = p.config.ServiceAccountEmail
|
||||
}
|
||||
|
||||
driver, err := googlecompute.NewDriverGCE(ui, builderProjectId,
|
||||
p.config.account, p.config.VaultGCPOauthEngine)
|
||||
|
Loading…
x
Reference in New Issue
Block a user