Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take ownership of an existing destination secret #545

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ type Destination struct {
Name string `json:"name"`
// Create the destination Secret.
// If the Secret already exists this should be set to false.
Create bool `json:"create,omitempty"`
// +kubebuilder:default=false
Create bool `json:"create"`
// Overwrite the destination Secret if it exists and Create is true. This is
// useful when migrating to VSO from a previous secret deployment strategy.
// +kubebuilder:default=false
Overwrite bool `json:"overwrite"`
// Labels to apply to the Secret. Requires Create to be set to true.
Labels map[string]string `json:"labels,omitempty"`
// Annotations to apply to the Secret. Requires Create to be set to true.
Expand Down
9 changes: 9 additions & 0 deletions chart/crds/secrets.hashicorp.com_hcpvaultsecretsapps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -65,12 +66,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
hcpAuthRef:
description: 'HCPAuthRef to the HCPAuth resource, can be prefixed
Expand Down
9 changes: 9 additions & 0 deletions chart/crds/secrets.hashicorp.com_vaultdynamicsecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -68,12 +69,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
mount:
description: Mount path of the secret's engine in Vault.
Expand Down
9 changes: 9 additions & 0 deletions chart/crds/secrets.hashicorp.com_vaultpkisecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -77,12 +78,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
excludeCNFromSans:
description: 'ExcludeCNFromSans from DNS or Email Subject Alternate
Expand Down
9 changes: 9 additions & 0 deletions chart/crds/secrets.hashicorp.com_vaultstaticsecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -60,12 +61,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
hmacSecretData:
default: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -65,12 +66,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
hcpAuthRef:
description: 'HCPAuthRef to the HCPAuth resource, can be prefixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -68,12 +69,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
mount:
description: Mount path of the secret's engine in Vault.
Expand Down
9 changes: 9 additions & 0 deletions config/crd/bases/secrets.hashicorp.com_vaultpkisecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -77,12 +78,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
excludeCNFromSans:
description: 'ExcludeCNFromSans from DNS or Email Subject Alternate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
to be set to true.
type: object
create:
default: false
description: Create the destination Secret. If the Secret already
exists this should be set to false.
type: boolean
Expand All @@ -60,12 +61,20 @@ spec:
name:
description: Name of the Secret
type: string
overwrite:
default: false
description: Overwrite the destination Secret if it exists and
Create is true. This is useful when migrating to VSO from a
previous secret deployment strategy.
type: boolean
type:
description: Type of Kubernetes Secret. Requires Create to be
set to true. Defaults to Opaque.
type: string
required:
- create
- name
- overwrite
type: object
hmacSecretData:
default: true
Expand Down
1 change: 1 addition & 0 deletions docs/api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ _Appears in:_
| --- | --- |
| `name` _string_ | Name of the Secret |
| `create` _boolean_ | Create the destination Secret. If the Secret already exists this should be set to false. |
| `overwrite` _boolean_ | Overwrite the destination Secret if it exists and Create is true. This is useful when migrating to VSO from a previous secret deployment strategy. |
| `labels` _object (keys:string, values:string)_ | Labels to apply to the Secret. Requires Create to be set to true. |
| `annotations` _object (keys:string, values:string)_ | Annotations to apply to the Secret. Requires Create to be set to true. |
| `type` _[SecretType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#secrettype-v1-core)_ | Type of Kubernetes Secret. Requires Create to be set to true. Defaults to Opaque. |
Expand Down
Loading
Loading