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

fix: handle changed Juju secret owner content behaviour #132

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tonyandrewmeyer
Copy link

As of Juju 3.1.7 (and 3.3.1, and all versions from 3.4.0 onwards) the behaviour of accessing secret content in Juju has changed:

  • In Juju <= 3.1.6 the secret owner would always refresh when getting the secret content, and they cannot explicitly do a refresh
  • In Juju >=3.1.7 the secret owner has the same behaviour as all other secret users: they get the tracked revision unless they use peek or refresh (and they can use refresh now)

This change breaks the data_secrets library, because it gets the secret content (e.g. to add a new key:value) and that will now be the current revision, so will not have any local changes. In practice, this means that data_secrets can no longer add multiple secrets because when the second one is added, it's added to the revision that didn't have the first one.

The secret owner is able to use peek in both 3.1.6 and 3.1.7, so the safe change is to always use peek - this is required in 3.1.7, and has no effect in 3.1.6.

@tonyandrewmeyer
Copy link
Author

From what I can tell, the pyright failures are not introduced in this branch, but if they are please let me know and I can dig into what's happening there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant