Add RemoteApplication and -Endpoint to description #1

Merged
merged 3 commits into from Feb 28, 2017

Conversation

Projects
None yet
2 participants
Member

babbageclunk commented Feb 23, 2017

This will allow dump-model to work on models with cross-model relations.

For now remote applications will be serializable but not importable. We
don't want to accidentally allow a migration to appear to succeed while
not migrating remote applications from the source model, and migrating
remote applications will require much more thought.

Handle remote applications in model.Validate. Since there are no units
in the local model for a remote application, we can't check that the
settings for the endpoints and units match up.

remoteapplication.go
+ // TODO(babbageclunk): implement importing remote applications
+ if val, ok := sourceMap["remote-applications"]; ok {
+ if items, ok := val.([]interface{}); ok && len(items) != 0 {
+ return nil, errors.New("importing remote applications is not supported yet")
@babbageclunk

babbageclunk Feb 23, 2017

Member

I can see an argument for filling the deserialization code in now and preventing importing of remote applications in migration_import instead, but this was easier (and it's not any harder to do it later). I'm alright with doing it if others feel strongly.

Add RemoteApplication and -Endpoint to description
For now these will be serializable but not importable - we don't want to
accidentally allow a migration to succeed while not migrating remote
applications from the source model.

Handle remote applications in model.Validate. Since there are no units
in the local model for a remote application, we can't check that the
settings for the endpoints and units match up.

Unfortunately a lot more is needed here.

remote-applications are not part of the version 1 or models. We need to have a version 2 model that includes remote-applications.

Also, the deserialisation should be done at the same time. Importing in the state package can fail, but the model serialization should be complete.

Member

babbageclunk commented Feb 28, 2017

Now with deserialisation of remote applications and endpoints and version 2 of the model format.

Member

babbageclunk commented Feb 28, 2017

$$merge$$

@howbazaar howbazaar merged commit 6686f41 into juju:master Feb 28, 2017

@babbageclunk babbageclunk deleted the babbageclunk:remote-apps branch Feb 28, 2017

jujubot added a commit to juju/juju that referenced this pull request Feb 28, 2017

Merge pull request #7049 from babbageclunk/dump-remote-apps-split
Include remote applications in model dump

## Description of change

This means that we can see remote applications in the dump-model output. At the moment we don't support importing models with remote applications - that requires a lot of other changes to work correctly.

Uses the new RemoteApplication and RemoteEndpoint added to the description in juju/description#1

## QA steps

* Bootstrap a controller and add two models
* Deploy wordpress to one model and mysql to the other and relate them.
* Run `juju dump-model` on each model and verify that the YAML includes the remote application information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment