Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Work around the destroy storage error #3769

Merged
merged 1 commit into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ProfileModelList extends React.Component {
type: 'destructive'
}];
const message = `Are you sure you want to destroy ${model.name}?`
+ ' All the applications and units included in the model will be'
+ ' All the applications, units and storage used by the model will be'
+ ' destroyed. This action cannot be undone.';
this.setState({
notification: (
Expand Down
7 changes: 6 additions & 1 deletion jujugui/static/gui/src/app/store/env/controller-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,12 @@ window.yui.add('juju-controller-api', function(Y) {
tagKey = 'tag';
}
const entities = ids.map(function(id) {
return {[tagKey]: tags.build(tags.MODEL, id)};
return {
[tagKey]: tags.build(tags.MODEL, id),
// TODO(frankban): allow for selecting not to destroy storage.
// This will be available when switching to jujulib.
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue created to track this: #3770

'destroy-storage': true
};
});
// Send the API request.
this._send_rpc({
Expand Down
8 changes: 4 additions & 4 deletions jujugui/static/gui/src/test/test_controller_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ describe('Controller API', function() {
version: 4,
request: 'DestroyModels',
params: {models: [
{'model-tag': 'model-default'}
{'model-tag': 'model-default', 'destroy-storage': true}
]},
'request-id': 1
});
Expand All @@ -662,7 +662,7 @@ describe('Controller API', function() {
version: 3,
request: 'DestroyModels',
params: {entities: [
{tag: 'model-default'}
{tag: 'model-default', 'destroy-storage': true}
]},
'request-id': 1
});
Expand All @@ -687,8 +687,8 @@ describe('Controller API', function() {
version: 4,
request: 'DestroyModels',
params: {models: [
{'model-tag': 'model-test-1'},
{'model-tag': 'model-test-2'}
{'model-tag': 'model-test-1', 'destroy-storage': true},
{'model-tag': 'model-test-2', 'destroy-storage': true}
]},
'request-id': 1
});
Expand Down