Skip to content

Commit

Permalink
Fixed linting errors in azuredevops/internal/service/taskagent/resour…
Browse files Browse the repository at this point in the history
…ce_variable_group.go
  • Loading branch information
tmeckel committed Jun 28, 2020
1 parent ef6d38d commit 3db9de4
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
secretVgValue = "secret_value"
vgIsSecret = "is_secret"
vgKeyVault = "key_vault"
vgServiceEndpointId = "service_endpoint_id"
vgServiceEndpointID = "service_endpoint_id"
vgContentType = "content_type"
vgEnabled = "enabled"
vgExpires = "expires"
Expand Down Expand Up @@ -124,7 +124,7 @@ func ResourceVariableGroup() *schema.Resource {
Required: true,
ValidateFunc: validate.NoEmptyStrings,
},
vgServiceEndpointId: {
vgServiceEndpointID: {
Type: schema.TypeString,
Required: true,
ValidateFunc: validate.UUID,
Expand Down Expand Up @@ -334,19 +334,19 @@ func expandVariableGroupParameters(d *schema.ResourceData) (*taskagent.VariableG
Variables: &variableMap,
}

key_vault := d.Get(vgKeyVault).([]interface{})
keyVault := d.Get(vgKeyVault).([]interface{})

// Note: this will be of length 1 based on the schema definition above.
if len(key_vault) == 1 {
keyVaultValues := key_vault[0].(map[string]interface{})
if len(keyVault) == 1 {
keyVaultValues := keyVault[0].(map[string]interface{})

serviceEndpointId, err := uuid.Parse(keyVaultValues[vgServiceEndpointId].(string))
serviceEndpointID, err := uuid.Parse(keyVaultValues[vgServiceEndpointID].(string))
if err != nil {
return nil, nil, err
}

variableGroup.ProviderData = taskagent.AzureKeyVaultVariableGroupProviderData{
ServiceEndpointId: &serviceEndpointId,
ServiceEndpointID: &serviceEndpointID,
Vault: converter.String(keyVaultValues[vgName].(string)),
}

Expand Down Expand Up @@ -473,7 +473,7 @@ func flattenKeyVault(d *schema.ResourceData, variableGroup *taskagent.VariableGr

keyVault := []map[string]interface{}{{
vgName: providerData.Vault,
vgServiceEndpointId: providerData.ServiceEndpointId.String(),
vgServiceEndpointID: providerData.ServiceEndpointId.String(),
}}

return keyVault, nil
Expand Down

0 comments on commit 3db9de4

Please sign in to comment.