Juju does not support setting owner label using secret-get

Bug #2017042 reported by Ian Booth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Yang Kelvin Liu

Bug Description

Looking up a secret using a label is broke. Steps to reproduce from the CI test below.
The last line fails.
Looking at the db, there's no label recorded for the application owned secret in secret metadata.

 juju --show-log deploy easyrsa
 juju --show-log deploy etcd
 juju --show-log integrate etcd easyrsa

 secret_owned_by_easyrsa_0=$(juju exec --unit easyrsa/0 -- secret-add --owner unit owned-by=easyrsa/0)
 secret_owned_by_easyrsa_0_id=$(echo $secret_owned_by_easyrsa_0 | awk '{n=split($0,a,"/"); print a[n]}')
 secret_owned_by_easyrsa=$(juju exec --unit easyrsa/0 -- secret-add owned-by=easyrsa-app)
 secret_owned_by_easyrsa_id=$(echo $secret_owned_by_easyrsa | awk '{n=split($0,a,"/"); print a[n]}')

 echo "Set a label for the unit owned secret $secret_owned_by_easyrsa_0."
 juju exec --unit easyrsa/0 -- secret-set "$secret_owned_by_easyrsa_0" --label=easyrsa_0
 echo "Set a consumer label for the app owned secret $secret_owned_by_easyrsa."
 juju exec --unit easyrsa/0 -- secret-get "$secret_owned_by_easyrsa" --label=easyrsa-app

 # secret-get by label or consumer label - content.
 juju exec --unit easyrsa/0 -- secret-get --label=easyrsa_0 | grep 'owned-by: easyrsa/0'
 juju exec --unit easyrsa/0 -- secret-get --label=easyrsa-app | grep 'owned-by: easyrsa-app'

Changed in juju:
status: Triaged → In Progress
Thomas Miller (tlmiller)
Changed in juju:
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
summary: - secret lookup by label broken
+ Juju does not support setting owner label using secret-get
Revision history for this message
Yang Kelvin Liu (kelvin.liu) wrote :
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
Changed in juju:
milestone: 3.1.3 → 3.1.5
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.