Skip to content

Commit

Permalink
Change all references from NoZeroValues to NoEmptyStrings (#2477)
Browse files Browse the repository at this point in the history
* Change all references to NoZerValues to NoEmptyStrings

* correcting imports

* Testing line endings

* Fixing line endings

* Fix lint errors

* Permission to merge per KT
  • Loading branch information
WodansSon authored Dec 11, 2018
1 parent 6f4e1e0 commit e305ea1
Show file tree
Hide file tree
Showing 50 changed files with 146 additions and 137 deletions.
4 changes: 2 additions & 2 deletions azurerm/data_source_monitor_action_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -15,7 +15,7 @@ func dataSourceArmMonitorActionGroup() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameForDataSourceSchema(),
Expand Down
4 changes: 2 additions & 2 deletions azurerm/data_source_public_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -15,7 +15,7 @@ func dataSourceArmPublicIP() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameForDataSourceSchema(),
Expand Down
6 changes: 3 additions & 3 deletions azurerm/data_source_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -15,13 +15,13 @@ func dataSourceArmSubnet() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"virtual_network_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameForDataSourceSchema(),
Expand Down
4 changes: 2 additions & 2 deletions azurerm/data_source_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -16,7 +16,7 @@ func dataSourceArmVirtualNetwork() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameForDataSourceSchema(),
Expand Down
4 changes: 2 additions & 2 deletions azurerm/data_source_virtual_network_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -20,7 +20,7 @@ func dataSourceArmVirtualNetworkGateway() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameForDataSourceSchema(),
Expand Down
4 changes: 2 additions & 2 deletions azurerm/helpers/azure/key_vault_child.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"strings"

"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
)

type KeyVaultChildID struct {
Expand Down Expand Up @@ -55,7 +55,7 @@ func ValidateKeyVaultChildName(v interface{}, k string) (warnings []string, erro
// Unfortunately this can't (easily) go in the Validate package
// since there's a circular reference on this package
func ValidateKeyVaultChildId(i interface{}, k string) (warnings []string, errors []error) {
if warnings, errors = validation.NoZeroValues(i, k); len(errors) > 0 {
if warnings, errors = validate.NoEmptyStrings(i, k); len(errors) > 0 {
return warnings, errors
}

Expand Down
3 changes: 1 addition & 2 deletions azurerm/helpers/validate/base64.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
)

func Base64String() schema.SchemaValidateFunc {
return func(i interface{}, k string) (warnings []string, errors []error) {
// Empty string is not allowed
if warnings, errors = validation.NoZeroValues(i, k); len(errors) > 0 {
if warnings, errors = NoEmptyStrings(i, k); len(errors) > 0 {
return
}

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_api_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S
"host_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"key_vault_id": {
Expand All @@ -794,7 +794,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S
Type: schema.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
ConflictsWith: []string{
fmt.Sprintf("hostname_configuration.0.%s.0.key_vault_id", schemaName),
},
Expand All @@ -804,7 +804,7 @@ func apiManagementResourceHostnameSchema(schemaName string) map[string]*schema.S
Type: schema.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
ConflictsWith: []string{
fmt.Sprintf("hostname_configuration.0.%s.0.key_vault_id", schemaName),
},
Expand Down
5 changes: 3 additions & 2 deletions azurerm/resource_arm_automation_dsc_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -38,13 +39,13 @@ func resourceArmAutomationDscConfiguration() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"content_embedded": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameSchema(),
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_automation_dsc_nodeconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -27,22 +27,22 @@ func resourceArmAutomationDscNodeConfiguration() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"automation_account_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameSchema(),

"content_embedded": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"configuration_name": {
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_automation_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -26,14 +26,14 @@ func resourceArmAutomationModule() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"automation_account_name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameSchema(),
Expand Down
9 changes: 5 additions & 4 deletions azurerm/resource_arm_autoscale_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand All @@ -30,7 +31,7 @@ func resourceArmAutoScaleSetting() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"resource_group_name": resourceGroupNameSchema(),
Expand Down Expand Up @@ -59,7 +60,7 @@ func resourceArmAutoScaleSetting() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},
"capacity": {
Type: schema.TypeList,
Expand Down Expand Up @@ -100,7 +101,7 @@ func resourceArmAutoScaleSetting() *schema.Resource {
"metric_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},
"metric_resource_id": {
Type: schema.TypeString,
Expand Down Expand Up @@ -320,7 +321,7 @@ func resourceArmAutoScaleSetting() *schema.Resource {
"service_uri": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},
"properties": {
Type: schema.TypeMap,
Expand Down
3 changes: 1 addition & 2 deletions azurerm/resource_arm_azuread_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"log"

"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"

"github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
Expand All @@ -26,7 +25,7 @@ func resourceArmActiveDirectoryApplication() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"homepage": {
Expand Down
7 changes: 4 additions & 3 deletions azurerm/resource_arm_container_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2018-10-01/containerinstance"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -62,22 +63,22 @@ func resourceArmContainerGroup() *schema.Resource {
"server": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
ForceNew: true,
},

"username": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
ForceNew: true,
},

"password": {
Type: schema.TypeString,
Required: true,
Sensitive: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
ForceNew: true,
},
},
Expand Down
3 changes: 2 additions & 1 deletion azurerm/resource_arm_container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -63,7 +64,7 @@ func resourceArmContainerRegistry() *schema.Resource {
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},
Set: azureRMHashLocation,
},
Expand Down
3 changes: 2 additions & 1 deletion azurerm/resource_arm_databricks_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/response"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -51,7 +52,7 @@ func resourceArmDatabricksWorkspace() *schema.Resource {
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"managed_resource_group_id": {
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_dev_test_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func resourceArmDevTestPolicy() *schema.Resource {
"threshold": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"evaluator_type": {
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_devspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func resourceArmDevSpaceController() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.NoZeroValues,
ValidateFunc: validate.NoEmptyStrings,
},

"target_container_host_resource_id": {
Expand Down
Loading

0 comments on commit e305ea1

Please sign in to comment.