-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17181 from wallyworld/secret-consumer-logic
juju#17181 This PR add state and service logic for getting and saving secret consumer info. This is needed so that units can consumer secrets with the revision tracked. The DDL needed to be changed as well. There were some unnecessary tables for application consumer which are not needed. It's also not necessary to use a uuid for the secret consumer tables as this is a join table and we just need the secret and unit uuids. And the associated triggers are removed since we'll be using a different approach to fire the relevant watchers. The secret consumer table had a FK for the secret id. But for cross model secrets, the id does not exist in the model so the FK needs to be removed. But we have checks in the txn that the secret exists where needed (for local secrets). In mongo, we needed to denormalise the latest revision and stick it in the consumer record. We don't do that now so there's a bit of fallout. The LatestRevision attr on SecretConsumerMetadata is not used any more except for old state code. For local secrets, we can look up the latest revision when needed. From model secrets, we'll need to add a table to store them. For now, just local secrets will work. A small driveby improvement - rename the Revision attribute of the SecretRevisionInfo struct to LatestRevision. ## QA steps bootstrap ``` $ juju add-secret mysecret --info "some secret" foo=bar secret:cob1il8r4jm2b5mh01ng $ juju exec -u controller/0 -- secret-get cob1il8r4jm2b5mh01ng foo: bar ``` ## Links **Jira card:** JUJU-5855
- Loading branch information
Showing
31 changed files
with
707 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
apiserver/facades/controller/crossmodelsecrets/mocks/secretservice.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.