-
Notifications
You must be signed in to change notification settings - Fork 494
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 #13538 from hpidcock/fix-storage-id
#13538 Storage hooks don't include the storage hook context which makes it difficult for operator framework to give useful abstractions. This PR adds JUJU_STORAGE_ID JUJU_STORAGE_KIND and JUJU_STORAGE_LOCATION to the hook env when storage hooks are run. Example values: ``` JUJU_STORAGE_ID=data/0 JUJU_STORAGE_KIND=filesystem JUJU_STORAGE_LOCATION=/data ``` ## QA steps Using https://github.com/hpidcock/testing-charms/tree/master/simpletest ``` $ juju bootstrap localhost $ juju deploy ~/projects/testing-charms/simpletest --storage data=1G $ juju show-status-log simpletest/0 Time Type Status Message 01 Dec 2021 14:35:29+10:00 juju-unit allocating 01 Dec 2021 14:35:29+10:00 workload waiting waiting for machine 01 Dec 2021 14:36:49+10:00 workload waiting installing agent 01 Dec 2021 14:36:50+10:00 workload waiting agent initializing 01 Dec 2021 14:36:50+10:00 juju-unit executing running data-storage-attached hook 01 Dec 2021 14:36:50+10:00 workload maintenance Storage attached for data data/0 filesystem /data 01 Dec 2021 14:36:50+10:00 juju-unit executing running install hook 01 Dec 2021 14:36:50+10:00 workload maintenance Installing thing 01 Dec 2021 14:36:51+10:00 juju-unit executing running leader-elected hook 01 Dec 2021 14:36:51+10:00 juju-unit executing running config-changed hook 01 Dec 2021 14:36:51+10:00 juju-unit executing running start hook 01 Dec 2021 14:36:51+10:00 workload maintenance Starting thing 01 Dec 2021 14:36:51+10:00 juju-unit idle ``` ## Documentation changes Need to add JUJU_STORAGE_ID JUJU_STORAGE_KIND and JUJU_STORAGE_LOCATION to hook env docs. ## Bug reference https://bugs.launchpad.net/juju/+bug/1948228
- Loading branch information
Showing
7 changed files
with
92 additions
and
33 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
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
Oops, something went wrong.