onepassword-operator icon indicating copy to clipboard operation
onepassword-operator copied to clipboard

Add custom annotations to Secrets

Open luca-valentini opened this issue 3 years ago • 4 comments

Summary

Provide a way to add custom annotations to Secrets.

Use cases

I need to create a webhook to execute certain actions when a Secret is modified. I need some additional information to decide what do to. Annotations would be the best way to pass that information.

Proposed solution

The implementation has been added and removed in the last months. It should be basically reverting this PR: https://github.com/1Password/onepassword-operator/pull/104 or reimplementing it only copying specific annotations, prefixed in a certain way or something similar.

Is there a workaround to accomplish this today?

Not that I'm aware of. The only way to pass additional information is to use the Secret name, but the character limit doesn't allow me to achieve what I want.

luca-valentini avatar May 20 '22 12:05 luca-valentini

Actually, because of that, we cannot use 1Password in our integration, as some of the components are expecting particular annotations. If you don't want to copy generated annotations as mentioned in #104, then please do something like:

apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
  name: some-secret
  namespace: exampe
spec:
  template:
    metadata:
      annotations:
        example-annotation: that-will-be-propagated-to-secret
  itemPath: vaults/exampe/items/some-secret
type: kubernetes.io/dockerconfigjson

Similarly, labels can be moved, but please do that with a deprecation period.

hudymi avatar Aug 11 '22 08:08 hudymi

Also, please take a look at how https://github.com/bitnami-labs/sealed-secrets is handling it.

hudymi avatar Sep 26 '22 17:09 hudymi

Hi guys,

Is there a way now to add annotaions to secrets? Or is there roadmap when it should be added?

Regards!

mbathe19 avatar May 11 '23 12:05 mbathe19

Hey folks! 👋

Thank you for raising this and for your patience!

I can see this being a useful thing to have based on the use cases presented in this issue, as well as the ones presented in #144.

I will raise this with the team to further investigate how we want to bring this functionality back while avoiding the concerns that were addressed with #104.

edif2008 avatar Nov 30 '23 12:11 edif2008