Add Busy status to models when upgrading #6763

Merged
merged 1 commit into from Mar 23, 2017

Conversation

Projects
None yet
4 participants
Contributor

perrito666 commented Jan 4, 2017

Model Status now holds upgrading information, useful
for automation scripts that require to wait on
juju until upgrade is complete.

QA Steps

Deploy this version of juju and upgrade
Run juju status and model status should be busy with a message indicating that the upgrade is taking place or available with a message indicating that upgrade just took place.

state/upgrade.go
@@ -210,6 +211,42 @@ func (info *UpgradeInfo) isModelUUIDUpgradeDone() (bool, error) {
return n > 0, nil
}
+// upgradeStatusHistoryAndOps sets the model's status history and returns ops for
+// setting model status according to the UpgradeStatus.
+func upgradeStatusHistoryAndOps(st *State, upgradeStatus UpgradeStatus, now int64) ([]txn.Op, error) {
@howbazaar

howbazaar Jan 9, 2017

Owner

Where are the tests or setting the status on a model?

@perrito666

perrito666 Jan 12, 2017

Contributor

Sorry I should have marked this as WIP

state/upgrade.go
+ if err != nil {
+ return nil, errors.Trace(err)
+ }
+ globalKey := model.globalKey()
@howbazaar

howbazaar Jan 9, 2017

Owner

Don't do this. You are getting a database object for no reason. Just use the 'modelGlobalKey' constant.

@perrito666

perrito666 Jan 12, 2017

Contributor

tx, will do

state/upgrade.go
+ switch upgradeStatus {
+ case UpgradeComplete:
+ modelStatus = status.Available
+ msg = "recently upgraded"
@howbazaar

howbazaar Jan 9, 2017

Owner

This will almost always be a lie. It won't be recent at all.

@perrito666

perrito666 Jan 12, 2017

Contributor

Good catch, ill add a more informative message

@perrito666 perrito666 changed the title from Add "is controller upgrading" to status. to Add Busy status to models when upgrading Jan 12, 2017

Contributor

perrito666 commented Feb 1, 2017

hey @howbazaar please re-check this after the changes, tx also !!rerunchecks!!

Owner

jameinel commented Feb 22, 2017

!!build!!

Contributor

perrito666 commented Mar 21, 2017

!!build!!

Contributor

perrito666 commented Mar 21, 2017

!!wouldyouwbuildthisffs!!

Contributor

perrito666 commented Mar 21, 2017

!!retry!!

Contributor

perrito666 commented Mar 21, 2017

!!Ireallyhatethisbot!!

This looks reasonable to me, I'd like Tim to give it a once-over and then we'll merge it.

Owner

howbazaar commented Mar 22, 2017

@jameinel bollocks, we now need to make sure we migrate the status and status history for models. We could do that in a follow up branch as long as it gets in for 2.2.

Owner

jameinel commented Mar 23, 2017

$$merge$$

Contributor

jujubot commented Mar 23, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 39307c9 into juju:develop Mar 23, 2017

1 check passed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. 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