kubeclient 0.0.5 → 0.0.6
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.
Potentially problematic release.
This version of kubeclient might be problematic. Click here for more details.
- checksums.yaml +8 -8
 - data/lib/kubeclient.rb +24 -27
 - data/lib/kubeclient/version.rb +1 -1
 - data/test/node_test.rb +0 -11
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                MGU0ZWMzMDI2NTkyM2E2OWJjNjg3ZGM3ZmNkZDBkZmYyNmI5YTYzNg==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                Yzc4YzNkMDA5MWM2OGQ0ZjlmNTUzNjQ0NDc0NzJmYjdiNjRhZjEwNA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                YjFhN2QzNDg3YTkwZWFkYTA1MzQ4OGJiYjk5ZDBkZTM3NjBjMzBjOWQyYzZj
         
     | 
| 
      
 10 
     | 
    
         
            +
                ZDY1NmUyOTVhYTBlMjVhZDE3MzdhYWU1ZDYxZTEzNjU3YmIwMDg0YmE4NTQ1
         
     | 
| 
      
 11 
     | 
    
         
            +
                N2RhNmYzZDJkMzdlMTc4ZTYwNmYyMDM0ZTg2OGY1MTVjYThmMzM=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                YzU5MDAwZGU1MTEyMTU0YmE3MmZhYTlkZmRmYTYzNGRiNzEzNjViN2YyN2Q0
         
     | 
| 
      
 14 
     | 
    
         
            +
                YzlmMWMwZGNiNGE1ZGIyOTc2OGM2YzFlNWJlNTZlNTlkNDk5ZDVhNTBiMzI2
         
     | 
| 
      
 15 
     | 
    
         
            +
                NTg1NjhhN2VkNGVjNTRhMmJiYTMxNzhmODBhODhkODQzY2QyNDk=
         
     | 
    
        data/lib/kubeclient.rb
    CHANGED
    
    | 
         @@ -95,36 +95,33 @@ module Kubeclient 
     | 
|
| 
       95 
95 
     | 
    
         | 
| 
       96 
96 
     | 
    
         
             
                 end
         
     | 
| 
       97 
97 
     | 
    
         | 
| 
       98 
     | 
    
         
            -
                  
     | 
| 
       99 
     | 
    
         
            -
                    
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
                      
     | 
| 
       105 
     | 
    
         
            -
             
     | 
| 
       106 
     | 
    
         
            -
                      
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
     | 
    
         
            -
                       raise exception
         
     | 
| 
       109 
     | 
    
         
            -
                     end
         
     | 
| 
      
 98 
     | 
    
         
            +
                 define_method("create_#{entity.underscore}") do |entity_config|
         
     | 
| 
      
 99 
     | 
    
         
            +
                   #to_hash should be called because of issue #9 in recursive open struct
         
     | 
| 
      
 100 
     | 
    
         
            +
                   hash = entity_config.to_hash
         
     | 
| 
      
 101 
     | 
    
         
            +
                   #keys should be renamed from underscore to k8s json naming style (camelized w first word lowercase)
         
     | 
| 
      
 102 
     | 
    
         
            +
                   hash = rename_keys(hash, "camelize", :lower)
         
     | 
| 
      
 103 
     | 
    
         
            +
                   begin
         
     | 
| 
      
 104 
     | 
    
         
            +
                     rest_client[entity.pluralize.camelize(:lower)].post(hash.to_json)
         
     | 
| 
      
 105 
     | 
    
         
            +
                   rescue  RestClient::Exception => e
         
     | 
| 
      
 106 
     | 
    
         
            +
                     exception = KubeException.new(e.http_code, JSON.parse(e.response)['message'] )
         
     | 
| 
      
 107 
     | 
    
         
            +
                     raise exception
         
     | 
| 
       110 
108 
     | 
    
         
             
                   end
         
     | 
| 
      
 109 
     | 
    
         
            +
                 end
         
     | 
| 
       111 
110 
     | 
    
         | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
       113 
     | 
    
         
            -
             
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
                     end
         
     | 
| 
      
 111 
     | 
    
         
            +
                 define_method("update_#{entity.underscore}") do |entity_config|
         
     | 
| 
      
 112 
     | 
    
         
            +
                   id = entity_config.id
         
     | 
| 
      
 113 
     | 
    
         
            +
                   #to_hash should be called because of issue #9 in recursive open struct
         
     | 
| 
      
 114 
     | 
    
         
            +
                   hash = entity_config.to_hash
         
     | 
| 
      
 115 
     | 
    
         
            +
                   #temporary solution to delete id till this issue is solved: https://github.com/GoogleCloudPlatform/kubernetes/issues/3085
         
     | 
| 
      
 116 
     | 
    
         
            +
                   hash.delete(:id)
         
     | 
| 
      
 117 
     | 
    
         
            +
                   #keys should be renamed from underscore to k8s json naming style (camelized w first word lowercase)
         
     | 
| 
      
 118 
     | 
    
         
            +
                   hash = rename_keys(hash, "camelize", :lower)
         
     | 
| 
      
 119 
     | 
    
         
            +
                   begin
         
     | 
| 
      
 120 
     | 
    
         
            +
                     rest_client[entity.underscore.pluralize+"/#{id}"].put(hash.to_json)
         
     | 
| 
      
 121 
     | 
    
         
            +
                   rescue  RestClient::Exception => e
         
     | 
| 
      
 122 
     | 
    
         
            +
                     exception = KubeException.new(e.http_code, JSON.parse(e.response)['message'] )
         
     | 
| 
      
 123 
     | 
    
         
            +
                     raise exception
         
     | 
| 
       126 
124 
     | 
    
         
             
                   end
         
     | 
| 
       127 
     | 
    
         
            -
             
     | 
| 
       128 
125 
     | 
    
         
             
                 end
         
     | 
| 
       129 
126 
     | 
    
         | 
| 
       130 
127 
     | 
    
         
             
               end
         
     | 
    
        data/lib/kubeclient/version.rb
    CHANGED
    
    
    
        data/test/node_test.rb
    CHANGED
    
    | 
         @@ -27,15 +27,4 @@ class NodeTest < MiniTest::Test 
     | 
|
| 
       27 
27 
     | 
    
         
             
                assert_equal 1000, node.resources.capacity.cpu
         
     | 
| 
       28 
28 
     | 
    
         
             
              end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
              def test_create_node_fail
         
     | 
| 
       31 
     | 
    
         
            -
                our_node = Node.new
         
     | 
| 
       32 
     | 
    
         
            -
                our_node.id = 'newnode'
         
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
                stub_request(:delete, /.*nodes*/).
         
     | 
| 
       35 
     | 
    
         
            -
                    to_return(:status => 405)
         
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                client = Kubeclient::Client.new 'http://localhost:8080/api/' , "v1beta1"
         
     | 
| 
       38 
     | 
    
         
            -
                assert_raises(NoMethodError) { client.create_node our_node }
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
              end
         
     | 
| 
       41 
30 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: kubeclient
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Alissa Bonas
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015-01- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-01-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |