Lazily create storage registry in client storage facade #13027
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The client storage facade was creating the storage pool manager and registry in the constructor. These objects need an instantiated provider instance to work. However, creating a provider instance hits the cloud provider apis. Running status therefore was impacted by these cloud api calls.
This PR only creates the storage pool manager and registry for those facade calls that need them, eg creating a storage pool. The read only apis used by status now no longer hit the cloud apis.
QA steps
Regression test storage behaviour.
bootstrap lxd
juju create-storage-pool test tmpfs foo=bar
juju storage-pools
juju storage-pools --name=lxd
juju storage-pools --provider=tmpfs
juju deploy postgresql --storage pgdata=lxd
juju status --storage
Bug reference
https://bugs.launchpad.net/juju/+bug/1908102