moby-derp 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/moby_derp/container.rb +3 -1
 - data/lib/moby_derp/pod.rb +4 -0
 - data/smoke_tests/root_labels.bats +27 -0
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4c1246d1a7563d646c3e0626cf32e4ab35d425890d0cf61645f94e56ef11be68
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f51695848c2d42402c3664d514e6f6870279b40658fa2ff90253c31ab2977f36
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 92c6fdb5e9fff6ed7eb06ad3bdbcc0c881c174c94058ab97ab6e3ae67e0236b7f60cea48cf4814ea50a6b4684c00f47803c4182ebdaad3c486b78a529d56bb0e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e1d08cf1af42df813f7a2bef9f318bafb2af7d2ee8b18f9de9e40978040023d3fb1160257271ca2fdfd9422d56dd04f1254516e0fc773bcc9ee6d83dd4f15711
         
     | 
    
        data/lib/moby_derp/container.rb
    CHANGED
    
    | 
         @@ -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 
     | 
    
         
            -
            				 
     | 
| 
      
 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
    
    
| 
         @@ -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. 
     | 
| 
      
 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: []
         
     |