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

feat: Added labels to easily find secrets what created for cluster

Open Tom910 opened this issue 3 years ago • 2 comments

What this PR does:

Right now cass-operator create 3 secret per cluster

  • ${nameCluster}-superuser
  • ${Datacenter.Name}-keystore
  • ${Datacenter.Name}-ca-keystore

and only one ${nameCluster}-superuser has base labels and so, I can't find all the secrets created for a cluster with a command like kubectl get secret -l 'k8ssandra.io/cluster-name=my-cluster'. My cases - I want to delete all secrets after deleting a cluster (right now I generate a name but using a label would be easy)

Which issue(s) this PR fixes: Fixes #

Checklist

  • [ ] Changes manually tested
  • [ ] Automated Tests added/updated
  • [ ] Documentation added/updated
  • [x] CHANGELOG.md updated (not required for documentation PRs)
  • [x] CLA Signed: DataStax CLA

Tom910 avatar Jun 30 '22 15:06 Tom910

Hi, thanks for the PR. Some other things that could be nice would be adding a test in secrets_test.go to verify the labels are there. And of course, we could autodelete them by setting a controller reference to all generated secrets so that deletion of CassandraDatacenter deletes the secrets also without manual process.

burmanm avatar Jul 01 '22 10:07 burmanm

Hi @Tom910,

do you still plan to work on this PR?

Thanks

adejanovski avatar Aug 30 '22 12:08 adejanovski

Closing this in favor of https://github.com/k8ssandra/cass-operator/pull/608

burmanm avatar Jan 11 '24 16:01 burmanm