Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state: add machine storage for subordinates #6336

Merged
merged 1 commit into from Sep 28, 2016

Conversation

axw
Copy link
Contributor

@axw 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

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
@axw
Copy link
Contributor Author

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

out.volumeAttachments[k] = v
}
for k, v := range rhs.volumeAttachments {
out.volumeAttachments[k] = v
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice pattern

@axw
Copy link
Contributor Author

axw commented Sep 28, 2016

$$merge$$

@jujubot
Copy link
Collaborator

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
Labels
None yet
Projects
None yet
3 participants