Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion testing/src/scenario/mocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _check_can_manage_secret(
):
if secret.owner is None:
raise SecretNotFoundError(
'this secret is not owned by this unit/app or granted to it. '
'this secret is not owned by this unit/app. '
'Did you forget passing it to State.secrets?',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion is not correct - any time we get into _check_can_manage_secret we have retrieved the secret from the state, so we know that it's there.

What we should suggest is that they forgot to set the owner attribute on the testing.Secret.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered that based on your comment on the issue. Sadly it looks like my comment along those lines got eaten (I probably left it in 'preview' mode before I submitted my review). Thanks for catching this.

)
if secret.owner == 'app' and not self.is_leader():
Expand Down