diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index cef8680..e2ea13c 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -13,8 +13,8 @@ // limitations under the License. // Package v1alpha1 contains API Schema definitions for the vault.finleap.cloud v1alpha1 API group -//+kubebuilder:object:generate=true -//+groupName=vault.finleap.cloud +// +kubebuilder:object:generate=true +// +groupName=vault.finleap.cloud package v1alpha1 import ( diff --git a/api/v1alpha1/vaultsecret_types.go b/api/v1alpha1/vaultsecret_types.go index 273bb2d..3050f80 100644 --- a/api/v1alpha1/vaultsecret_types.go +++ b/api/v1alpha1/vaultsecret_types.go @@ -131,6 +131,9 @@ type VaultSecretSpec struct { // Array of vault path references where to gather data from for the secret. // +optional DataFrom []VaultSecretDataRef `json:"dataFrom,omitempty"` + // Array of labels for the created secret. + // +optional + SecretLabels map[string]string `json:"secretLabels,omitempty"` } // VaultSecretStatus defines the observed state of VaultSecret diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index dfee8e9..445851d 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -182,6 +182,13 @@ func (in *VaultSecretSpec) DeepCopyInto(out *VaultSecretSpec) { *out = make([]VaultSecretDataRef, len(*in)) copy(*out, *in) } + if in.SecretLabels != nil { + in, out := &in.SecretLabels, &out.SecretLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultSecretSpec. diff --git a/charts/vault-operator/templates/crds.yaml b/charts/vault-operator/templates/crds.yaml index 57b9511..5140be0 100644 --- a/charts/vault-operator/templates/crds.yaml +++ b/charts/vault-operator/templates/crds.yaml @@ -1,4 +1,3 @@ -{{- if .Values.deployCRDs }} # Generated by 'make manifests' apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -183,6 +182,11 @@ spec: - path type: object type: array + secretLabels: + additionalProperties: + type: string + description: Array of labels for the created secret. + type: object secretName: description: Optional name of secret which is created by this object. type: string @@ -239,4 +243,3 @@ status: plural: "" conditions: [] storedVersions: [] -{{- end }} \ No newline at end of file diff --git a/config/crd/bases/vault.finleap.cloud_vaultsecrets.yaml b/config/crd/bases/vault.finleap.cloud_vaultsecrets.yaml index 23e744c..c6a08fc 100644 --- a/config/crd/bases/vault.finleap.cloud_vaultsecrets.yaml +++ b/config/crd/bases/vault.finleap.cloud_vaultsecrets.yaml @@ -169,6 +169,11 @@ spec: - path type: object type: array + secretLabels: + additionalProperties: + type: string + description: Array of labels for the created secret. + type: object secretName: description: Optional name of secret which is created by this object. type: string