Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Migrate local charm no resource #7387
Conversation
howbazaar
added some commits
May 24, 2017
| + var fp charmresource.Fingerprint | ||
| + if rev.FingerprintHex != "" { | ||
| + fp, err = charmresource.ParseFingerprint(rev.FingerprintHex) | ||
| + if err != nil { |
| @@ -1,4 +1,3 @@ | ||
| -// Copyright 2016 Canonical Ltd. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
Error: retrieving gpg key timed out. $$try-again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$try-again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
howbazaar commentedMay 25, 2017
•
Edited 1 time
-
jameinel
May 25, 2017
Description of change
If a model deployed a local charm that has resources defined, but did not define any resources for that application, the model would fail to migrate. Also a local charm with local resources would migrate one time, but fail on subsequent attempts.
This branch fixes both of those problems. Firstly, resource definitions for an application where there is no actual resource are now handled by the model import code in the state package, rather in the binary upload process where it attempted to push empty placeholders. Also validation of the resource fingerprint was loosened so it doesn't try to validate an empty string.
QA steps
Long... firstly make sure you have juju-ci-tools charms repo available, as I'm using their local charm. The resource itself is a simple index.html file that contains a string that you can validate came from the resource.
Bootstrap a controller and add two models, one for the local charm with a resource, and one with a local charm without a resource.
Ensure that the resource is being used by using a web browser to look at the ip address of the machine that the app is deployed to.
Wait for the models to be fully deployed then bootstrap another controller to migrate the models to.
Wait for the migration to complete then ensure they are in the target controller. Add a unit to the resource model to make sure the resource is available.
Ensure it is used by looking at the IP address of machine-1 from the resource model.
Now migrate the models back
Wait for the migration to complete, then add another unit to the resource model and check again.
Documentation changes
No docs needed, just fixing migration bugs.
Bug reference
https://bugs.launchpad.net/juju/+bug/1692610
https://bugs.launchpad.net/juju/+bug/1692646