Improve comments for FillParameters

This commit is contained in:
Paul Meyer 2019-09-25 17:16:17 +00:00
parent feeae1514e
commit 094a8840d8
2 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,7 @@ func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (pack
ctx, cancel := context.WithCancel(ctx)
defer cancel()
// FillParameters function will set the authType from supplied parameters set the subscription and tenant id.
// FillParameters function captures authType and sets defaults.
err := b.config.ClientConfig.FillParameters()
if err != nil {
return nil, err

View File

@ -254,6 +254,8 @@ func (c Config) GetServicePrincipalTokens(
return servicePrincipalToken, servicePrincipalTokenVault, nil
}
// FillParameters capture the user intent from the supplied parameter set in authType, retrieves the TenantID and CloudEnvironment if not specified.
// The SubscriptionID is also retrieved in case MSI auth is requested.
func (c *Config) FillParameters() error {
if c.authType == "" {
if c.useDeviceLogin() {