Skip to content

Commit

Permalink
PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartleeks committed Apr 8, 2019
1 parent 3bae5d8 commit 7efa33c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion azurerm/data_source_batch_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func dataSourceArmBatchCertificate() *schema.Resource {
Required: true,
ValidateFunc: validateAzureRMBatchAccountName,
},
"resource_group_name": resourceGroupNameSchema(),
"resource_group_name": resourceGroupNameForDataSourceSchema(),
"public_data": {
Type: schema.TypeString,
Computed: true,
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_batch_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func resourceArmBatchCertificateCreate(d *schema.ResourceData, meta interface{})
thumbprintAlgorithm := d.Get("thumbprint_algorithm").(string)
name := thumbprintAlgorithm + "-" + thumbprint

if err := validateFormatAndPassword(format, password); err != nil {
if err := validateBatchCertificateFormatAndPassword(format, password); err != nil {
return err
}

Expand Down Expand Up @@ -188,7 +188,7 @@ func resourceArmBatchCertificateUpdate(d *schema.ResourceData, meta interface{})
thumbprint := d.Get("thumbprint").(string)
thumbprintAlgorithm := d.Get("thumbprint_algorithm").(string)

if err := validateFormatAndPassword(format, password); err != nil {
if err := validateBatchCertificateFormatAndPassword(format, password); err != nil {
return err
}

Expand Down Expand Up @@ -245,7 +245,7 @@ func resourceArmBatchCertificateDelete(d *schema.ResourceData, meta interface{})
return nil
}

func validateFormatAndPassword(format string, password string) error {
func validateBatchCertificateFormatAndPassword(format string, password string) error {
if format == "Pfx" && password == "" {
return fmt.Errorf("Batch Certificate Password is required when Format is `Pfx`")
}
Expand Down
6 changes: 5 additions & 1 deletion azurerm/resource_arm_batch_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func resourceArmBatchPool() *schema.Resource {
Type: schema.TypeString,
Required: true,
ValidateFunc: azure.ValidateResourceID,
DiffSuppressFunc: suppress.CaseDifference,
// The ID returned for the certificate in the batch account and the certificate applied to the pool
// are not consistent in their casing which causes issues when referencing IDs across resources
// (as Terraform still sees differences to apply due to the casing)
// Handling by ignoring casing for now. Raised as an issue: https://github.com/Azure/azure-rest-api-specs/issues/5574
DiffSuppressFunc: suppress.CaseDifference,
},
"store_location": {
Type: schema.TypeString,
Expand Down

0 comments on commit 7efa33c

Please sign in to comment.