Skip to content

Commit

Permalink
change validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasAng committed Apr 28, 2021
1 parent f3c1b53 commit 6590e10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand All @@ -27,7 +28,7 @@ func dataSourceContainerRegistryScopeMap() *schema.Resource {
"container_registry_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},
"resource_group_name": azure.SchemaResourceGroupNameForDataSource(),
"description": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand All @@ -39,7 +40,7 @@ func resourceContainerRegistryScopeMap() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"description": {
Expand All @@ -54,7 +55,7 @@ func resourceContainerRegistryScopeMap() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"actions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand All @@ -24,13 +25,13 @@ func dataSourceContainerRegistryToken() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"container_registry_name": {
Type: schema.TypeString,
Required: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"resource_group_name": azure.SchemaResourceGroupNameForDataSource(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func resourceContainerRegistryToken() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"resource_group_name": azure.SchemaResourceGroupName(),
Expand All @@ -48,7 +48,7 @@ func resourceContainerRegistryToken() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: ValidateContainerRegistryName,
ValidateFunc: validate.ContainerRegistryName,
},

"scope_map_id": {
Expand Down

0 comments on commit 6590e10

Please sign in to comment.