Juju emits secret-remove hook on tracking secrect revision

Bug #2023364 reported by Weii Wang
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Yang Kelvin Liu

Bug Description

When a charm application first creates a secret then the secret owner reads the secret with the refresh option. The secret-remove event will be emitted by juju on revision 1, despite revision 1 being the only revision for the secret.

Here are the steps to reproduce this problem on juju controller version 3.1.2:
```
$ juju add-model test-secret-remove
Added 'test-secret-remove' model on workstation-microk8s/localhost with credential 'workstation-microk8s' for user 'admin'
$ juju deploy any-charm --channel edge
Located charm "any-charm" in charm-hub, revision 5
Deploying "any-charm" from charm-hub charm "any-charm", revision 5 in channel beta on ubuntu@22.04/stable
$ juju wait-for application any-charm
Application "any-charm" is running
properties:
  life: alive
  status: active
$ juju exec --unit any-charm/0 -- secret-add --owner application foo=bar
secret:ci1d7cvubg2s77u5l07g
$ juju exec --unit any-charm/0 -- secret-get secret:ci1d7cvubg2s77u5l07g --refresh
foo: bar
$ juju debug-log
unit-any-charm-0: 15:25:09 INFO juju.worker.uniter.operation ran "secret-remove" hook (via hook dispatching script: dispatch)
```

Harry Pidcock (hpidcock)
Changed in juju:
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
importance: Undecided → High
milestone: none → 3.1.4
status: New → Triaged
Changed in juju:
milestone: 3.1.4 → 3.1.5
Changed in juju:
milestone: 3.1.5 → 3.1.6
Changed in juju:
status: Triaged → In Progress
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
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.