Skip to content

Commit a65159c

Browse files
authored
Change topology_key to required attribute (#1743)
1 parent 4301739 commit a65159c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

kubernetes/schema_affinity_spec.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package kubernetes
22

33
import (
4-
"regexp"
5-
64
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
75
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
86
)
@@ -164,10 +162,9 @@ func podAffinityTermFields() map[string]*schema.Schema {
164162
Set: schema.HashString,
165163
},
166164
"topology_key": {
167-
Type: schema.TypeString,
168-
Description: "empty topology key is interpreted by the scheduler as 'all topologies'",
169-
Optional: true,
170-
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^.+$`), "value cannot be empty"),
165+
Type: schema.TypeString,
166+
Description: "empty topology key is interpreted by the scheduler as 'all topologies'",
167+
Required: true,
171168
},
172169
}
173170
}

website/docs/r/daemon_set_v1.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ The following arguments are supported:
255255

256256
* `label_selector` - (Optional) A label query over a set of resources, in this case pods.
257257
* `namespaces` - (Optional) Specifies which namespaces the `label_selector` applies to (matches against). Null or empty list means "this pod's namespace"
258-
* `topology_key` - (Optional) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed.
258+
* `topology_key` - (Required) This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the `label_selector` in the specified namespaces, where co-located is defined as running on a node whose value of the label with key `topology_key` matches that of any node on which any of the selected pods is running. Empty `topology_key` is not allowed.
259259

260260
### `preferred_during_scheduling_ignored_during_execution`
261261

0 commit comments

Comments
 (0)