moby-derp 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31c2c89cac1b196c48dc2c2183367d61578b1e4e1bae1ff7d698dd7ef6c23cb5
4
- data.tar.gz: c7b83663a971a01f3e8b5e8a5420b12b6192d207107ce1cd3047539644051f3e
3
+ metadata.gz: 4c1246d1a7563d646c3e0626cf32e4ab35d425890d0cf61645f94e56ef11be68
4
+ data.tar.gz: f51695848c2d42402c3664d514e6f6870279b40658fa2ff90253c31ab2977f36
5
5
  SHA512:
6
- metadata.gz: 34c40eb8d1d8cfa668a3048c6a8ceaf231c4fae6a607d389bf073d3a3874a74a10a31e728c0c322476a154c9c425fd92869d0fb5849707c1dee2b4c0970f15af
7
- data.tar.gz: 01d15f3f197b48fe5748f27718a8e8c7035ff0713113742bf1ae7a43a480197ab7a97559e4ae19fbec8ca5711d22ebd38f02865194e9ce73a817b11a0899bf9a
6
+ metadata.gz: 92c6fdb5e9fff6ed7eb06ad3bdbcc0c881c174c94058ab97ab6e3ae67e0236b7f60cea48cf4814ea50a6b4684c00f47803c4182ebdaad3c486b78a529d56bb0e
7
+ data.tar.gz: e1d08cf1af42df813f7a2bef9f318bafb2af7d2ee8b18f9de9e40978040023d3fb1160257271ca2fdfd9422d56dd04f1254516e0fc773bcc9ee6d83dd4f15711
@@ -127,7 +127,9 @@ module MobyDerp
127
127
  params["Labels"] = @pod.common_labels.merge(@config.labels)
128
128
  params["Labels"]["org.hezmatt.moby-derp.pod-name"] = @pod.name
129
129
 
130
- unless @root_container
130
+ if @root_container
131
+ params["Labels"] = @pod.root_labels.merge(params["Labels"])
132
+ else
131
133
  params["Labels"]["org.hezmatt.moby-derp.root-container-id"] = @pod.root_container_id
132
134
  end
133
135
  end
data/lib/moby_derp/pod.rb CHANGED
@@ -48,6 +48,10 @@ module MobyDerp
48
48
  @config.common_labels
49
49
  end
50
50
 
51
+ def root_labels
52
+ @config.root_labels
53
+ end
54
+
51
55
  def common_environment
52
56
  @config.common_environment
53
57
  end
@@ -0,0 +1,27 @@
1
+ load test_helper
2
+
3
+ @test "Core labels" {
4
+ config_file <<-'EOF'
5
+ root_labels:
6
+ foo: booblee
7
+ containers:
8
+ bob:
9
+ image: busybox:latest
10
+ command: sleep 1
11
+ common_labels:
12
+ moby-derp-smoke-test: ayup
13
+ EOF
14
+
15
+ run $MOBY_DERP_BIN $TEST_CONFIG_FILE
16
+
17
+ echo "status: $status"
18
+ echo "output: $output"
19
+
20
+ [ "$status" = "0" ]
21
+ container_running "mdst"
22
+ container_running "mdst.bob"
23
+
24
+ docker inspect mdst --format='{{.Config.Labels}}'
25
+ docker inspect mdst --format='{{.Config.Labels}}' | grep 'map.*foo:booblee'
26
+ ! docker inspect mdst.bob --format='{{.Config.Labels}}' | grep 'map.*foo:booblee'
27
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moby-derp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
@@ -223,6 +223,7 @@ files:
223
223
  - smoke_tests/exposed.bats
224
224
  - smoke_tests/minimal.bats
225
225
  - smoke_tests/no_file.bats
226
+ - smoke_tests/root_labels.bats
226
227
  - smoke_tests/test_helper.bash
227
228
  homepage: http://github.com/mpalmer/moby-derp
228
229
  licenses: []