Secret info rotates values in Juju and Scenario

This is quick note reporting my findings about the rotates field.

Info read back for a the newly created secret omits this field in the same dispatch, because the secret has not been committed yet and therefore the rotation point has not been determined:

> juju exec --unit test-secrets/0 'foo=$(secret-add foo=bar --rotate daily); secret-info-get $foo' 
d3oagbvmp25c786f8hj0:
  revision: 1
  label: ""
  owner: application
  rotation: daily

Info read in a separate hook does show this value:

> ◦ juju exec --unit test-secrets/0 'secret-info-get d3oagbvmp25c786f8hj0'
d3oagbvmp25c786f8hj0:
  revision: 1
  label: ""
  owner: application
  rotation: daily
  rotates: 2025-10-17T08:09:20Z

This field is always None when read by the charm code in ops[testing], and the field is not exposed in the scafoolding ops.testing.Secret object. The Scenario code contains a comment “not implemented yet”.

That’s all!

Let us know what you think :slight_smile:

in scenario it would be easy enough to determine whether we should omit the ‘rotates’ value: namely if the secret is not in the input state. Because that’d mean that we just created the secret in this hook.

1 Like