Merge lp:~lazypower/charms/trusty/flannel-docker/trunk into lp:charms/trusty/flannel-docker

Proposed by Charles Butler
Status: Merged
Merged at revision: 11
Proposed branch: lp:~lazypower/charms/trusty/flannel-docker/trunk
Merge into: lp:charms/trusty/flannel-docker
Diff against target: 28 lines (+3/-7)
1 file modified
playbooks/network-relation-changed.yaml (+3/-7)
To merge this branch: bzr merge lp:~lazypower/charms/trusty/flannel-docker/trunk
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Approve
Review via email: mp+259786@code.launchpad.net

Description of the change

Older revisions of the charm had edgecase breakage when working with multiple clusters.

The flannel charm now supports working with 2 docker clusters, such as the following

juju deploy cs:~kubernetes/trusty/etcd

juju deploy trusty/docker cluster1
juju add-unit -n 5 cluster1

juju deploy trusty/docker cluster2
juju add-unit -n 5 cluster2

juju deploy flannel-docker
juju add-relation flannel-docker:docker-host cluster1
juju add-relation flannel-docker:docker-host cluster2
juju add-relation flannel-docker:db etcd:client
juju add-relation flannel-docker:network cluster1:network
juju add-relation flannel-docker:network cluster2:network

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote :

Greetings Charles!

Thanks for the latest fixes to the flannel-docker charm! The ansible code
change looks safe and logical. I ran this latest
code on our CI system and saw it pass on Azure, HP, and Joyent. I also
deployed the scenario that you listed in the description which worked fine.

I merged your changes with the exising flannel-docker charm. Thank you for
this quality submission!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playbooks/network-relation-changed.yaml'
2--- playbooks/network-relation-changed.yaml 2015-04-01 18:46:10 +0000
3+++ playbooks/network-relation-changed.yaml 2015-05-21 15:36:49 +0000
4@@ -3,10 +3,6 @@
5 # Note: this is necessary when being called from
6 # network-relation-changed, not from db-relation-joined.
7
8-- name: Find Docker-Host network relation-id
9- shell: relation-ids network
10- register: docker_host_rel_id
11-
12 # Read data from flannel config
13 - name: Read Flannel Subnet
14 shell: cat /run/flannel/subnet.env | grep FLANNEL_SUBNET | cut -f2 -d"="
15@@ -17,10 +13,10 @@
16 register: flannel_mtu
17
18 - set_fact:
19- host_rel_id: "{{ docker_host_rel_id.stdout }}"
20 flannel_mtu: "{{ flannel_mtu.stdout }}"
21 flannel_subnet: "{{ flannel_subnet.stdout }}"
22+ scoped_network: "{{ relations.network[0].__relid__ | default('') }}"
23
24 - name: Send Data to Docker Host for bridge configuration
25- shell: relation-set -r {{ host_rel_id }} flannel-subnet={{ flannel_subnet }} flannel-mtu={{ flannel_mtu }} overlay_type=udp
26- when: host_rel_id != ""
27+ shell: relation-set -r {{ scoped_network }} flannel-subnet={{ flannel_subnet }} flannel-mtu={{ flannel_mtu }} overlay_type=udp
28+ when: scoped_network != ""

Subscribers

People subscribed via source and target branches

to all changes: