Skip to content

Commit 8e26f4f

Browse files
authored
Fix resource_field_ref schema for projected_volume (#1189)
1 parent 353b94a commit 8e26f4f

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

kubernetes/resource_kubernetes_pod_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ func TestAccKubernetesPod_with_projected_volume(t *testing.T) {
535535
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.projected.0.sources.3.downward_api.0.items.1.resource_field_ref.#", "1"),
536536
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.projected.0.sources.3.downward_api.0.items.1.resource_field_ref.0.container_name", "containername"),
537537
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.projected.0.sources.3.downward_api.0.items.1.resource_field_ref.0.resource", "limits.cpu"),
538+
resource.TestCheckResourceAttr("kubernetes_pod.test", "spec.0.volume.0.projected.0.sources.3.downward_api.0.items.1.resource_field_ref.0.divisor", "1"),
538539
),
539540
},
540541
},

kubernetes/schema_pod_spec.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,9 +879,12 @@ func volumeSchema(isUpdatable bool) *schema.Resource {
879879
Type: schema.TypeString,
880880
Required: true,
881881
},
882-
"quantity": {
883-
Type: schema.TypeString,
884-
Optional: true,
882+
"divisor": {
883+
Type: schema.TypeString,
884+
Optional: true,
885+
Default: "1",
886+
ValidateFunc: validateResourceQuantity,
887+
DiffSuppressFunc: suppressEquivalentResourceQuantity,
885888
},
886889
"resource": {
887890
Type: schema.TypeString,

website/docs/index.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ You can also configure the host, basic auth credentials, and client certificate
9191

9292
```hcl
9393
provider "kubernetes" {
94-
host = "https://cluster_endpoint:port"
94+
host = "https://cluster_endpoint:port"
9595
9696
client_certificate = file("~/.kube/client-cert.pem")
9797
client_key = file("~/.kube/client-key.pem")

website/docs/r/daemonset.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ The `option` block supports the following:
645645

646646
* `container_name` - (Optional) The name of the container
647647
* `resource` - (Required) Resource to select
648+
* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1".
648649

649650
### `se_linux_options`
650651

website/docs/r/deployment.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ The `option` block supports the following:
656656

657657
* `container_name` - (Optional) The name of the container
658658
* `resource` - (Required) Resource to select
659+
* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1".
659660

660661
### `se_linux_options`
661662

website/docs/r/pod.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ The `option` block supports the following:
705705

706706
* `container_name` - (Optional) The name of the container
707707
* `resource` - (Required) Resource to select
708+
* `divisor` - (Optional) Specifies the output format of the exposed resources, defaults to "1".
708709

709710
### `se_linux_options`
710711

0 commit comments

Comments
 (0)