Update the Operator SDK
Update the used Operator SDK to version 0.18.0
Add new field reconcileStrategy
to the CRD
It is also possible to change the default reconciliation strategy from Replace
to Merge
via the reconcileStrategy
key in the CRD. For the default Replace
strategy the complete secret is replaced. If you have an existing secret you can choose the Merge
strategy to add the keys from Vault to the existing secret.
Example:
- You have an existing secret
merge
with a keyfoo
- You create a vault secret with the same name and the key
hello
- The resulting secret contains both keys
foo
andhello
with theMerge
strategy
apiVersion: v1
kind: Secret
metadata:
name: merge
data:
foo: YmFyCg==
type: Opaque
apiVersion: ricoberger.de/v1alpha1
kind: VaultSecret
metadata:
name: merge
spec:
reconcileStrategy: Merge
keys:
- hello
path: kubernetes/merge
type: Opaque
apiVersion: v1
kind: Secret
metadata:
name: merge
data:
foo: YmFyCg==
hello: d29ybGQ=
type: Opaque