Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
state: introduce DestroyModelParams #7675
Conversation
| + // or released, which we can do in a cleanup. If the user did | ||
| + // not specify either, then we have already added prereq ops | ||
| + // to assert that there is no storage in the model. | ||
| + logger.Debugf("xxx ... %v", *args.DestroyStorage) |
axw
added some commits
Jul 26, 2017
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit a1819d5
into
juju:develop
Jul 27, 2017
1 check passed
github-check-merge-juju
Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
axw commentedJul 27, 2017
Description of change
We consolidate Model.Destroy and Model.DestroyIncludingHosted
into a single method, Model.Destroy, and introduce the
DestoryModelParams struct to control its behaviour. There are
two fields for now:
is the same as the removed Model.DestroyIncludingHosted
method; otherwise the behaviour is the same as the replaced
Model.Destroy method.
storage in the model, then destroying the model will fail
with an error that satisfies state.IsHasPersistentStorageError.
If the field's value is true, then all storage will be
destroyed. If the field's value is false, then the storage
will be released/disassociated from the model/controller.
To implement these changes, we have to extend the cleanup doc
with cleanup-specific arguments.
To check whether storage is persistent in hosted models, we
have had to change various volume and filesystem query functions
to operate on a database, instead of a state object. This
avoids an expensive State.ForModel call.
In a followup we'll extend the API and CLI to force the user to choose
between destroying or releasing storage when using the destroy-model
and destroy-controller commands.
QA steps
Controller should be destroyed, along with storage, as before.
Documentation changes
Not yet.
Bug reference
None.