Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JUJU-1693] Add secret-get --metadata and enforce label uniqueness #14522

Merged
merged 1 commit into from Aug 29, 2022

Conversation

wallyworld
Copy link
Member

@wallyworld wallyworld commented Aug 26, 2022

Add a new secret-get --metadata command to fetch just secret metadata.
Also enforce unique labels.
And cleanup some issues with the secret collections in mongo.

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • [ ] Integration tests, with comments saying what you're testing
  • [ ] doc.go added or updated in changed packages

QA steps

deploy ubuntu charm

juju exec --unit ubuntu/0 "secret-add data=foo --label=foo"
secret:cc452i9vd6n21aea8d00

juju exec --unit ubuntu/0 "secret-get secret:cc452i9vd6n21aea8d00"
data: foo

juju exec --unit ubuntu/0 "secret-get secret:cc452i9vd6n21aea8d00 --metadata"
cc452i9vd6n21aea8d00:
  revision: 1
  label: foo
  rotation: never

juju exec --unit ubuntu/0 "secret-get secret:cc452i9vd6n21aea8d00 --metadata --label foo"
ERROR specify either a secret URI or label but not both to fetch metadata

juju exec --unit ubuntu/0 "secret-get --metadata --label foo"
cc452i9vd6n21aea8d00:
  revision: 1
  label: foo
  rotation: never

juju exec --unit ubuntu/0 "secret-add data=foo --label=foo"
ERROR secret with label "foo" already exists

@wallyworld wallyworld changed the title Add secret-get --metadata and enforce label uniqueness [JUJU-1693] Add secret-get --metadata and enforce label uniqueness Aug 26, 2022
@wallyworld
Copy link
Member Author

/merge

@jujubot jujubot merged commit dd36272 into juju:develop Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants