Skip to content

Commit c2d1214

Browse files
authored
Add write-only attributes data_wo and binary_data_wo to kubernetes_secret_v1 (#2692)
1 parent 8aa8b4d commit c2d1214

File tree

9 files changed

+397
-82
lines changed

9 files changed

+397
-82
lines changed

.changelog/2692.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
`resource/kubernetes_secret_v1`: Add support for write only attributes for `data_wo` and `binary_data_wo`.
3+
```

.github/workflows/acceptance_tests_kind.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
default: "^TestAcc"
1212
terraformVersion:
1313
description: Terraform version
14-
default: 1.10.1
14+
default: 1.11.0-rc1 # FIXME change this v1.11.0 is released
1515
parallelRuns:
1616
description: The maximum number of tests to run simultaneously
1717
default: 8
@@ -29,8 +29,8 @@ env:
2929
KUBECONFIG: ${{ github.workspace }}/.kube/config
3030
KIND_VERSION: ${{ github.event.inputs.kindVersion || '0.25.0' }}
3131
PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || '8' }}
32-
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.10.1' }}
33-
32+
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.11.0-rc1' }} # FIXME change when v1.11.0 is released
33+
3434
jobs:
3535
acceptance_tests_kind:
3636
if: ${{ github.repository_owner == 'hashicorp' }}
@@ -56,11 +56,11 @@ jobs:
5656
# include if reference is v3-major-release and base reference is not v3-major-release
5757
- isMajorReleaseBranch: true
5858
isBaseMajorRelease: false
59-
kubernetes_version: v1.31.2@sha256:33034c0a75dd82b2f2f22bdf0a30ea2a42b2c3547a6d56c52c7ea9c1b5fb89b9
59+
kubernetes_version: v1.31.4@sha256:2cb39f7295fe7eafee0842b1052a599a4fb0f8bcf3f83d96c7f4864c357c6c30
6060
# include if reference is not v3-major-release and base reference is v3-major-release
6161
- isMajorReleaseBranch: false
6262
isBaseMajorRelease: true
63-
kubernetes_version: v1.31.2@sha256:33034c0a75dd82b2f2f22bdf0a30ea2a42b2c3547a6d56c52c7ea9c1b5fb89b9
63+
kubernetes_version: v1.31.4@sha256:2cb39f7295fe7eafee0842b1052a599a4fb0f8bcf3f83d96c7f4864c357c6c30
6464
steps:
6565
- name: Checkout repository
6666
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

.github/workflows/manifest_acc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444
# include if reference is v3-major-release and base reference is not v3-major-release
4545
- isMajorReleaseBranch: true
4646
isBaseMajorRelease: false
47-
kubernetes_version: v1.31.2@sha256:33034c0a75dd82b2f2f22bdf0a30ea2a42b2c3547a6d56c52c7ea9c1b5fb89b9
47+
kubernetes_version: v1.31.4@sha256:2cb39f7295fe7eafee0842b1052a599a4fb0f8bcf3f83d96c7f4864c357c6c30
4848
# include if reference is not v3-major-release and base reference is v3-major-release
4949
- isMajorReleaseBranch: false
5050
isBaseMajorRelease: true
51-
kubernetes_version: v1.31.2@sha256:33034c0a75dd82b2f2f22bdf0a30ea2a42b2c3547a6d56c52c7ea9c1b5fb89b9
51+
kubernetes_version: v1.31.4@sha256:2cb39f7295fe7eafee0842b1052a599a4fb0f8bcf3f83d96c7f4864c357c6c30
5252
terraform_version:
5353
- 1.9.8
5454
- 1.8.5

docs/resources/secret_v1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ The resource provides mechanisms to inject containers with sensitive information
2424

2525
- `binary_data` (Map of String, Sensitive) A map of the secret data in base64 encoding. Use this for binary data.
2626
- `data` (Map of String, Sensitive) A map of the secret data.
27+
- `binary_data_wo` (Map of String, Write-Only) BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. This field only accepts base64-encoded payloads that will be decoded/encoded before being sent/received to/from the apiserver.
28+
- `binary_data_wo_revision` (Number) The current revision of the write-only "binary_data_wo" attribute. Incrementing this integer value will cause Terraform to update the write-only value.`
29+
- `data_wo` (Map of String, Write-Only) Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.
30+
- `data_wo_revision` (Number) The current revision of the write-only "data_wo" attribute. Incrementing this integer value will cause Terraform to update the write-only value.`
2731
- `immutable` (Boolean) Ensures that data stored in the Secret cannot be updated (only object metadata can be modified).
2832
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
2933
- `type` (String) Type of secret

go.mod

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ require (
1111
github.com/hashicorp/go-hclog v1.6.3
1212
github.com/hashicorp/go-plugin v1.6.2
1313
github.com/hashicorp/go-version v1.7.0
14-
github.com/hashicorp/hc-install v0.9.0
14+
github.com/hashicorp/hc-install v0.9.1
1515
github.com/hashicorp/hcl/v2 v2.23.0
16-
github.com/hashicorp/terraform-exec v0.21.0
17-
github.com/hashicorp/terraform-json v0.23.0
16+
github.com/hashicorp/terraform-exec v0.22.0
17+
github.com/hashicorp/terraform-json v0.24.0
1818
github.com/hashicorp/terraform-plugin-docs v0.16.0
1919
github.com/hashicorp/terraform-plugin-framework v1.13.0
20-
github.com/hashicorp/terraform-plugin-go v0.25.0
20+
github.com/hashicorp/terraform-plugin-go v0.26.0
2121
github.com/hashicorp/terraform-plugin-log v0.9.0
2222
github.com/hashicorp/terraform-plugin-mux v0.17.0
23-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
23+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0
2424
github.com/hashicorp/terraform-plugin-testing v1.11.0
2525
github.com/jinzhu/copier v0.3.5
2626
github.com/mitchellh/go-homedir v1.1.0
2727
github.com/mitchellh/hashstructure v1.1.0
2828
github.com/robfig/cron v1.2.0
2929
github.com/stretchr/testify v1.8.3
30-
golang.org/x/mod v0.21.0
30+
golang.org/x/mod v0.22.0
3131
k8s.io/api v0.28.6
3232
k8s.io/apiextensions-apiserver v0.28.6
3333
k8s.io/apimachinery v0.28.6
@@ -42,7 +42,7 @@ require (
4242
github.com/Masterminds/goutils v1.1.1 // indirect
4343
github.com/Masterminds/semver/v3 v3.2.0 // indirect
4444
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
45-
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
45+
github.com/ProtonMail/go-crypto v1.1.3 // indirect
4646
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
4747
github.com/armon/go-radix v1.0.0 // indirect
4848
github.com/bgentry/speakeasy v0.1.0 // indirect
@@ -62,9 +62,9 @@ require (
6262
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
6363
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
6464
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
65-
golang.org/x/sync v0.9.0 // indirect
65+
golang.org/x/sync v0.10.0 // indirect
6666
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
67-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
67+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
6868
)
6969

7070
require (
@@ -78,7 +78,7 @@ require (
7878
github.com/fatih/camelcase v1.0.0 // indirect
7979
github.com/fatih/color v1.16.0 // indirect
8080
github.com/go-errors/errors v1.4.2 // indirect
81-
github.com/go-logr/logr v1.2.4 // indirect
81+
github.com/go-logr/logr v1.4.2 // indirect
8282
github.com/go-openapi/jsonpointer v0.19.6 // indirect
8383
github.com/go-openapi/jsonreference v0.20.2 // indirect
8484
github.com/go-openapi/swag v0.22.3 // indirect
@@ -96,7 +96,7 @@ require (
9696
github.com/hashicorp/go-multierror v1.1.1 // indirect
9797
github.com/hashicorp/go-uuid v1.0.3 // indirect
9898
github.com/hashicorp/logutils v1.0.0 // indirect
99-
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
99+
github.com/hashicorp/terraform-registry-address v0.2.4 // indirect
100100
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
101101
github.com/hashicorp/yamux v0.1.1 // indirect
102102
github.com/imdario/mergo v0.3.15 // indirect
@@ -126,18 +126,18 @@ require (
126126
github.com/spf13/pflag v1.0.5 // indirect
127127
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
128128
github.com/xlab/treeprint v1.2.0 // indirect
129-
github.com/zclconf/go-cty v1.15.0
129+
github.com/zclconf/go-cty v1.16.2
130130
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
131-
golang.org/x/crypto v0.29.0 // indirect
132-
golang.org/x/net v0.28.0 // indirect
133-
golang.org/x/oauth2 v0.22.0 // indirect
134-
golang.org/x/sys v0.27.0 // indirect
135-
golang.org/x/term v0.26.0 // indirect
136-
golang.org/x/text v0.20.0 // indirect
131+
golang.org/x/crypto v0.32.0 // indirect
132+
golang.org/x/net v0.34.0 // indirect
133+
golang.org/x/oauth2 v0.23.0 // indirect
134+
golang.org/x/sys v0.29.0 // indirect
135+
golang.org/x/term v0.28.0 // indirect
136+
golang.org/x/text v0.21.0 // indirect
137137
golang.org/x/time v0.3.0 // indirect
138138
google.golang.org/appengine v1.6.8 // indirect
139-
google.golang.org/grpc v1.67.1
140-
google.golang.org/protobuf v1.35.1 // indirect
139+
google.golang.org/grpc v1.69.4
140+
google.golang.org/protobuf v1.36.3 // indirect
141141
gopkg.in/inf.v0 v0.9.1 // indirect
142142
gopkg.in/yaml.v2 v2.4.0 // indirect
143143
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)