Skip to content

Commit

Permalink
azurerm_container_registry_task: Add schema validations for `agent_…
Browse files Browse the repository at this point in the history
…pool_name` and `agent_setting` (#28098)

* `azurerm_container_registry_task`: Add schema validations for `agent_pool_name` and `agent_setting`

* Update website/docs/r/container_registry_task.html.markdown

Co-authored-by: stephybun <steph@hashicorp.com>

---------

Co-authored-by: stephybun <steph@hashicorp.com>
  • Loading branch information
magodo and stephybun authored Nov 26, 2024
1 parent 26790cc commit 96826db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 8 additions & 5 deletions internal/services/containers/container_registry_task_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,19 @@ func (r ContainerRegistryTaskResource) Arguments() map[string]*pluginsdk.Schema
Elem: &pluginsdk.Resource{
Schema: map[string]*schema.Schema{
"cpu": {
Type: pluginsdk.TypeInt,
Required: true,
Type: pluginsdk.TypeInt,
Required: true,
ValidateFunc: validation.IntInSlice([]int{2}),
},
},
},
ConflictsWith: []string{"agent_pool_name"},
},
"agent_pool_name": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
ConflictsWith: []string{"agent_setting"},
},
"enabled": {
Type: pluginsdk.TypeBool,
Expand Down
4 changes: 3 additions & 1 deletion website/docs/r/container_registry_task.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ The following arguments are supported:

* `agent_setting` - (Optional) A `agent_setting` block as defined below.

~> **NOTE:** Only one of `agent_pool_name` and `agent_setting` can be specified.

* `enabled` - (Optional) Should this Container Registry Task be enabled? Defaults to `true`.

* `identity` - (Optional) An `identity` block as defined below.
Expand Down Expand Up @@ -93,7 +95,7 @@ The following arguments are supported:

A `agent_setting` block supports the following:

* `cpu` - (Required) The number of cores required for the Container Registry Task.
* `cpu` - (Required) The number of cores required for the Container Registry Task. Possible value is `2`.

---

Expand Down

0 comments on commit 96826db

Please sign in to comment.