Conversation
2b491aa to
b1b006e
Compare
|
Do you plan to eventually upgrade #2600 to be consistent with this enhanced approach to managing pushsecret metadata? |
|
Oh, i see. It's actually the same thing i'm using here, it's just documented wrong 😞 its |
|
This PR introduces a more sophisticated schema that moves the annotations and labels fields below the new spec field and defines new merge policy fields. Will the other provider be eventually upgraded to support this new schema? |
|
This is up to discussion if we want such a "convoluted" structure for metadata parameters. We could also keep it simple and unversioned. Though that will bite us in the future. |
|
Hi @moolen, is there a plan/timeframe for approving the linked PushSecret metadata proposal and subsequently moving this PR forward? Thanks! |
|
This seem a bit overcomplication of things, however, we need the feature that adds labels and annotations to the pushed secrets. Getting rid of the |
|
Any status updates regarding this PR? |
Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
3a673fe to
eaaceaa
Compare
| metadata: | ||
| apiVersion: kubernetes.external-secrets.io/v1alpha1 | ||
| kind: PushSecretMetadata | ||
| spec: | ||
| sourceMergePolicy: Merge # or Replace | ||
| targetMergePolicy: Merge # or Replace / Ignore | ||
| labels: | ||
| color: red | ||
| annotations: | ||
| yes: please |
There was a problem hiding this comment.
Not asking for the feature, just more for understanding - this bit would not be able to be templated right?
|
Nop, not templateable. |
|



Towards #3443. This PR enhances the Kubernetes provider to support both
.spec.template.metadataand.spec.data[0].metadata. It allows users to define bothlabelsandannotationson the target secret.targetMergePolicy=Ignore.👆 this is up for discussion. My point is that it should push the metadata by default, as expected by users described in #3443.
TODOs:
PushSecretMetadataspec.targetMergePolicyto control the behaviour when writing the metadata to the target secret, e.g.MergeorOverridespec.metadataMergePolicyto control if the source secret metadata (that includes the template metadata) and the.data[].metadatais merged or replaced.PushSecret Metadata
The Kubernetes provider is able to manage both
metadata.labelsandmetadata.annotationsof the secret on the target cluster.Users have different preferences on what metadata should be pushed. ESO by default pushes both labels and annotations to the target secret and merges them with the existing metadata.
You can specify the metadata in the
spec.template.metadatasection if you want to decouple it from the existing secret.Further, you can leverage the
.data[].metadatasection to fine-tine the behaviour of the metadata merge strategy. The metadata section is a versioned custom-resource alike structure, the behaviour is detailed below.Merge,ReplaceMergewill merge the metadata of the source secret with the metadata defined in.data[].metadata. WithReplace, the metadata in.data[].metadatareplaces the source metadata.Merge,Replace,IgnoreMerge, the source metadata is merged with the existing metadata from the target secret.Replacewill replace the target metadata with the metadata defined in the source.Ignoreleaves the target metadata as is.map[string]stringmap[string]string