state: add machine storage for subordinates #6336

Merged
merged 1 commit into from Sep 28, 2016

Conversation

Projects
None yet
3 participants
Member

axw commented Sep 28, 2016

When a subordinate unit is added, create its
machine storage when the principal unit is
assigned to a machine.

Fixes https://bugs.launchpad.net/juju/+bug/1595617

state: add machine storage for subordinates
When a subordinate unit is added, create its
machine storage when the principal unit is
assigned to a machine.

Fixes https://bugs.launchpad.net/juju/+bug/1595617
Member

axw commented Sep 28, 2016

QA

  1. bootstrap lxd
  2. deploy a principal charm
  3. deploy a subordinate charm with filesystem storage
  4. relate the two applications
  5. when the principal unit is added, check that there is a storage instance created, and an associated filesystem

mjs approved these changes Sep 28, 2016

+ out.volumeAttachments[k] = v
+ }
+ for k, v := range rhs.volumeAttachments {
+ out.volumeAttachments[k] = v
@mjs

mjs Sep 28, 2016

Contributor

I presume it's by design that the rhs wins if the same key appears in both sides?

@axw

axw Sep 28, 2016

Member

Storage instances cannot share a volume/filesystem (attachment), so it's impossible.

+}
+
+func (u *Unit) assignToCleanMaybeEmptyMachineOps(requireEmpty bool) (_ *Machine, _ []txn.Op, err error) {
+ failure := func(err error) (*Machine, []txn.Op, error) {
@mjs

mjs Sep 28, 2016

Contributor

nice pattern

Member

axw commented Sep 28, 2016

$$merge$$

Contributor

jujubot commented Sep 28, 2016

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

@jujubot jujubot merged commit e5fc227 into juju:master Sep 28, 2016

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