Updated juju's charm & charmstore dependencies #6324

Closed
wants to merge 44 commits into
from

Conversation

Projects
None yet
Contributor

kat-co commented Sep 26, 2016

No description provided.

perrito666 and others added some commits Sep 20, 2016

Fix all watcher dealing with remove/create
When removing and creating again an application, allwatcher
would report the application as removed in all deltas until
a new watching connection was made.
provider/gce: don't set sshKeys instance metadata
The GCE provider is bailing from StartInstances if
authorized-keys is empty. It should not be doing
this.

Also, we're only looking at authorized-keys in the
GCE provider to set the sshKeys instance metadata.
This is what GCE uses to keep track of the SSH keys
that *it* manages on an instance. We should not be
setting this; using cloud-init is sufficient.

Fixes https://bugs.launchpad.net/bugs/1625881
state: add safe refcounts for charm storage
This branch adds refcounts for charm storage:
when a storage instance is added, a refcount
is incremented for (owner, storage-name); and
decremented when the storage instance is removed.

We also check that no units are added to or
removed from an application while its charm
is being upgraded. This enables us to safely
drop charm storage if it is unreferenced.

These changes pave the way for upgrading charms
with storage, and make validation of charm-storage
min/max count constraints simpler. Previously we
were relying on there being a one-to-one mapping
between storage instances and attachments, which
leaves shared storage out in the cold; this new
approach caters for both.
Remove wrong region validation on add-model
add-model command was performing a double validation for region
and cloud and the second one was wrong.
Merge pull request #6300 from perrito666/fix_1625657
Remove wrong region validation on add-model

add-model command was performing a double validation for region
and cloud and the second one was wrong.

This fixes https://bugs.launchpad.net/juju/+bug/1625657

## QA steps
* Bootstrap a controller,
* Add a model with credentials not used to bootstrap the model.
Merge pull request #6294 from axw/provider-gce-no-sshkeys-metadata
provider/gce: don't set sshKeys instance metadata

The GCE provider is bailing from StartInstances if
authorized-keys is empty. It should not be doing
this.

Also, we're only looking at authorized-keys in the
GCE provider to set the sshKeys instance metadata.
This is what GCE uses to keep track of the SSH keys
that *it* manages on an instance. We should not be
setting this; using cloud-init is sufficient.

Fixes https://bugs.launchpad.net/bugs/1625881
Quick drive-by cleanup of receiver
There were 4 different receiver names for ModelManagerAPI: m, mm, s, c.
Now there is one: m.
apiserver: Remove charm get cache
The filesystem cache used when retrieving charms has been removed. It
was implemented when charms lived in a remote S3 bucket and is no longer
necessary now that charm live in MongoDB's GridFS store. This helps to
reduce disk space usage in the controllers and is one less thing that
needs cleaning up when models are removed.

See https://bugs.launchpad.net/juju/+bug/1608959
upgrades: Remove old apiserver charm get cache
This takes care of any charm get cache created by the apiserver in an
RC1 or earlier release.

Note the new style of testing upgrade steps (using the new findSteps
helper). This approach both ensures that the step is correctly wired up
and does what it's supposed to in the one test, and doesn't require
much in export_test.go.

The old test helpers have been removed.
Merge pull request #6303 from howbazaar/cert-updater-test-fix
Stop the serving info setter replacing the cert from the cert updater.

There was a race between the serving info setter and the cert updater.

Most of the time the serving info would run first, and set the cert based on the copy in the database. But sometimes the cert updater would run first and the new cert would be overwritten by the cert stored in the database.

## QA

Was able to reproduce the failure by running the test repeatedly while the machine was very busy.
Can no longer reproduce the failure.
Merge pull request #6302 from mjs/1608959-remove-apiserver-charm-cache
apiserver: Remove charm get cache

The filesystem cache used when retrieving charms has been removed. It
was implemented when charms lived in a remote S3 bucket and is no longer
necessary now that charm live in MongoDB's GridFS store. This helps to
reduce disk space usage in the controllers and is one less thing that
needs cleaning up when models are removed.

See https://bugs.launchpad.net/juju/+bug/1608959

### QA

Manually deployed charms and confirmed that old cache directory at `<datadir>/charm-get-cache` is no longer created and new `<datadir>/charm-get-tmp` directory is left empty.

Manually created the old `<datadir>/charm-get-cache` directory and populated it and then ran an upgrade. The directory was removed.
Fix bootstrap status cleanup
The cleanup of the provisioning status output wasn't accounting for the
3 extra characters prepended by the output function. This was leaving
the last characters of the provisioning output on the screen.
Merge pull request #6304 from mjs/bootstrap-formatting
Fix bootstrap status cleanup

The cleanup of the provisioning status output wasn't accounting for the
3 extra characters prepended by the output function. This was leaving
the last characters of the provisioning output on the screen.
Merge pull request #6297 from reedobrien/feature/region-support-to-state
Add region handling to UpdateModelConfigDefaultValues

Refs: model-config-tree

QA: Unit tests all pass.  This should have gone in with the rest of the backend model-config region bits. But it didn't it is required for the cli bits to work, so hoping to merge this so we can get feedback on the CLI bits.
Make list-* commands consistent
This change ensures that all list-* commands show the same style response when there are no
values to display.  It is a simple print to stderr that says 'No foos to display.'
This fixes https://bugs.launchpad.net/juju/+bug/1596687
Merge pull request #6285 from natefinch/fix-list
Make list-* commands consistent

This change ensures that all list-* commands show the same style response when there are no values to display. It is a simple print to stderr that says 'No foos to display.' This fixes https://bugs.launchpad.net/juju/+bug/1596687
Merge pull request #6283 from tasdomas/d011-deploy-steps-configurable
Make deploy steps configurable for testing.

The added function (NewDeployCommandWithSteps) mirrors the existing NewDeployCommandWithAPI and is to be used in testing the deploy command with custom deploy steps outside of juju.
Merge pull request #6306 from natefinch/fix-no-controller
fix up error handling when no current controller

fixes https://bugs.launchpad.net/juju/+bug/1618998
list-models should point out list-controllers command in error message

QA:
Edit ~/.local/share/juju/controllers.yaml to remove the value for current-controller
(it's at the bottom).  Then run juju status and juju models.  You should get nice 
error messages that tell you how to get out of the situation.  Also try changing
current-controller to a controller name that doesn't exist.  It should behave the
same as not having a current controller.
fix list-disabled-commands with empty output
When we fixed the error message for tabular output, we
accidentally messed up the json and yaml output, since
there was no restriction to only output the error message
for tabular.
apiserver/application: update SetCharm
This diff updates Application.SetCharm,
adding the ConfigSettings, ConfigSettingsYAML,
and StorageConstraints parameters. We will
pass these on to state, but state currently
will reject their use. This constitutes an
API break, so the facade version has been
bumped.

The apiserver/application code has been
updated to be mockable, and new tests have
been written using a mock backend.
Merge pull request #6310 from natefinch/list-blocks-json-empty
fix list-disabled-commands with empty output

When we fixed the error message for tabular output, we
accidentally messed up the json and yaml output, since
there was no restriction to only output the error message
for tabular.

fixes https://bugs.launchpad.net/juju/+bug/1626824
Merge pull request #6298 from axw/state-storage-setcharm-storageconst…
…raints-take2

state: add safe refcounts for charm storage

This branch adds refcounts for charm storage:
when a storage instance is added, a refcount
is incremented for (owner, storage-name); and
decremented when the storage instance is removed.

We also check that no units are added to or
removed from an application while its charm
is being upgraded. This enables us to safely
drop charm storage if it is unreferenced.

These changes pave the way for upgrading charms
with storage, and make validation of charm-storage
min/max count constraints simpler. Previously we
were relying on there being a one-to-one mapping
between storage instances and attachments, which
leaves shared storage out in the cold; this new
approach caters for both.

**QA**

1. bootstrap lxd
2. deploy charm with optional storage, min-count 0; don't assign any
3. remove storage from charm, and upgrade to it; fine, as it's not in-use
4. add required storage to charm, and upgrade to it; fails as you cannot
   add required storage during upgrade (yet)
5. make storage optional in charm again, and upgrade to it; works, as it's
   optional
6. add instances of the optional storage to the deployed unit, until we
   hit the declared maximum; ensure that once we hit the maximum, we cannot
   add any more
7. remove storage from charm, and try to upgrade to it; fails as the storage
   is in-use
8. make the storage required in the charm, and upgrade to it. Then remove
   the storage from the charm and try to upgrade to it; fails, as you cannot
   remove required storage (yet)
Merge pull request #6305 from axw/apiserver-application-unittests
apiserver/application: update SetCharm

This diff updates Application.SetCharm,
adding the ConfigSettings, ConfigSettingsYAML,
and StorageConstraints parameters. We will
pass these on to state, but state currently
will reject their use. This constitutes an
API break, so the facade version has been
bumped.

The apiserver/application code has been
updated to be mockable, and new tests have
been written using a mock backend.

**QA**

(server from 2.0rc1, client from this branch)
1. bootstrap 2.0rc1
2. deploy ubuntu
3. (with client built from this branch) upgrade-charm ubuntu

(server from this branch, client from 2.0rc1)
1. bootstrap from this branch
2. deploy ubuntu
3. (with client from 2.0rc1) upgrade-charm ubuntu

No QA for updating storage constraints or charm
settings yet, as that is not yet supported in state,
nor in the CLI/API client.
cmd/juju/application: refactor upgrade-charm
Refactor the upgrade-charm command code so that
it is unit-testable. Unit tests will be added in
a follow-up branch.
Merge pull request #6311 from axw/cmd-upgradecharm-refactor-unittest
cmd/juju/application: refactor upgrade-charm

Refactor the upgrade-charm command code so that
it is unit-testable. Unit tests will be added in
a follow-up branch.

**QA**

Non-functional change. Just ran tests.
Merge pull request #6315 from howbazaar/kill-controller-timeout
New API call, Controller.HostedModelConfig

This new API call is used in an upcoming PR that adds a timeout to the kill-controller command. Once the timeout is hit, the client will attempt to destroy all the models by talking to the provider directly. To do this, it needs to have the model's config and cloud config in order to be able to instantiate an Environ.

The facade version is not bumped as it is no danger to the client. If the client is newer than the server, which is possible for early RCs, then a timeout of 5 minutes will happen before the provider is invoked directly. The call will fail with NotImplemented, so will cause no further damage. kill-controller was written with the ability to call it more than once, so running the command again is expected behaviour.
api/unitassigner: fix intermittent test failure
The TestWatchUnitAssignment unit test was failing intermittently because
the test assumed that the underlying StringsWatcher would only run once.
When the watcher runs more than once the f.request field gets
overwritten triggering the assertion failure.

Fixes [LP:#1606302](https://bugs.launchpad.net/juju-core/+bug/1606302)
Merge pull request #6318 from frobware/master-lp1606302
api/unitassigner: fix intermittent test failure

The TestWatchUnitAssignment unit test was failing intermittently because
the test assumed that the underlying StringsWatcher would only run once.
When the watcher runs more than once the f.request field gets
overwritten triggering the assertion failure.

Fixes [LP:#1606302](https://bugs.launchpad.net/juju-core/+bug/1606302)
Merge pull request #6317 from anastasiamac/remove-jujuconnsuite-state
Use ConnSuite in state package instead of JujuConnSuite.
Fix intermittent test failure
Occasionally it would fail because the initial event would be picked up
before the stop actually happened in the watcher - we could see that
clearly by adding a sleep between the checkNext goroutine and calling
w.Stop(). It doesn't actually need the checkNext call to be done
concurrently.
Merge pull request #6289 from perrito666/fix_1610007
Fix all watcher dealing with remove/create

When removing and creating again an application, allwatcher
would report the application as removed in all deltas until
a new watching connection was made.

This fixes: https://launchpad.net/bugs/1610007

### QA steps:
* Run the tests.
Merge pull request #6319 from dimitern/testing-time
testing: Added ZeroTime() and NonZeroTime()

A couple of helpers added to coretesting, which can be used in tests to
avoid / minimize imports of the standard time package.
Merge pull request #6322 from babbageclunk/intermittent-failure
Fix intermittent test failure

Occasionally storeManagerSuite.TestMultiwatcherStop would fail because 
the initial event would be picked up before the stop actually happened in the
watcher - we could see that clearly by adding a sleep between the checkNext
goroutine and calling w.Stop(). It doesn't actually need the checkNext call to be 
done concurrently.

Fixes https://bugs.launchpad.net/juju/+bug/1606310
Owner

mitechie commented Sep 28, 2016

$$merge$$ testing a merge to staging here

Contributor

jujubot commented Sep 28, 2016

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

Owner

mitechie commented Sep 28, 2016

bah, never mind, this won't work as this is trying to merge to develop, tests are failing, and so can't confirm the staging test run is the full suite

Contributor

jujubot commented Sep 28, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/9348

@kat-co kat-co closed this Oct 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment