Add Model.EnvironVersion() #16

Merged
merged 1 commit into from Jul 6, 2017

Conversation

Projects
None yet
2 participants
Member

axw commented Jul 3, 2017

Add model v3, which includes a mandatory Environ version. This will be used by Juju to upgrade the environ/cloud provider resources for a model on controller upgrade or model migration.

model.go
+ // environ-version was added in version 3. For older schema versions,
+ // the environ-version will be set to the zero value.
+ if importVersion >= 3 {
+ num, err := version.Parse(valid["environ-version"].(string))
@howbazaar

howbazaar Jul 3, 2017

Owner

Why is environ-version a version and not just an integer?

@axw

axw Jul 4, 2017

Member

Good question. Originally it held the controller version, but it's not independent, and could just as well be an integer. I'll change it to an int when I'm back at work tomorrow.

@axw

axw Jul 5, 2017

Member

Updated, PTAL.

Add Model.EnvironVersion()
Add model v3, which includes a mandatory Environ version.

@axw axw referenced this pull request in juju/juju Jul 5, 2017

Merged

Introduce environ/provider versioning #7599

@axw axw merged commit b764a15 into juju:master Jul 6, 2017

jujubot added a commit to juju/juju that referenced this pull request Jul 7, 2017

Merge pull request #7599 from axw/environ-version
Introduce environ/provider versioning

## Description of change

Environs (i.e. the cloud representation of
a model) are now versioned, so that we can
upgrade them as necessary. Previously this
has been done as part of controller upgrades,
but this poses a problem when the environs
cannot be opened; thus we seek to decouple
the upgrading of a model's environ from the
upgrading of the controller.

EnvironProvider now has a Version method,
which returns the current/most up-to-date
environ version. Model docs now record the
version of the model's associated environ.
Environ upgrade operations specify an
environ/provider version, rather than
controller/agent version.

Once this lands, we will introduce a new
worker that will run under the model
dependency engine to upgrade the model's
environ, and which will gate access to the
model until that has happened.

Requires juju/description#16

(There is a drive-by fix in state/upgrade.go, to stop checking for env-uuid upgrades. That all happened before 2.0, so we don't need to carry that code anymore.)

## QA steps

No functional changes. Bootstrap azure with 2.1.x, juju upgrade-juju to this branch.

## Documentation changes

None.

## Bug reference

Part of the fix for https://bugs.launchpad.net/juju/+bug/1700451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment