kubeclient 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kubeclient might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWVlZDdiMTE0MDkxZTQ2NDhlMjNiOWQ1MWIzNmQxNzcxMTMwMGEyYQ==
4
+ MGU0ZWMzMDI2NTkyM2E2OWJjNjg3ZGM3ZmNkZDBkZmYyNmI5YTYzNg==
5
5
  data.tar.gz: !binary |-
6
- MTNmZDVlNzZjMzU1NTE4Yjc3MmYxYWNkMzY5MzdjM2Q2YzhhNDQ2ZA==
6
+ Yzc4YzNkMDA5MWM2OGQ0ZjlmNTUzNjQ0NDc0NzJmYjdiNjRhZjEwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjNhNTdlN2QzODllODU0YjgyNDZiNjlhYzc5M2M1OGVkNzYxOWUzMjE5N2Vl
10
- N2E1NjFiY2JkMDRlYTQyOTE1NzUxNDU0ZjhiODFiZjRhMjAyZWExYmZkNDNk
11
- YzkxNjU4YWFmOTFlMGM2NzkzMjE2ZmY1MmUwNmM2OGQ3MDJhYzU=
9
+ YjFhN2QzNDg3YTkwZWFkYTA1MzQ4OGJiYjk5ZDBkZTM3NjBjMzBjOWQyYzZj
10
+ ZDY1NmUyOTVhYTBlMjVhZDE3MzdhYWU1ZDYxZTEzNjU3YmIwMDg0YmE4NTQ1
11
+ N2RhNmYzZDJkMzdlMTc4ZTYwNmYyMDM0ZTg2OGY1MTVjYThmMzM=
12
12
  data.tar.gz: !binary |-
13
- MTY4ZGFjM2MyMGY5ODNiZWNjYWFmYzVlMzZhMmYwMTQ3YjY4YjFhM2MwNWRm
14
- NzVhM2IxN2Y3NTI5YWJhMGYzNWJjMGM2NzIzMDBmOTI2MjVkOGZiZmExZTEz
15
- NmZmODc5ZjM5OTMwNmIyZDMyMzg0MmMzNmY3Yjc2OTA3YzQyYWI=
13
+ YzU5MDAwZGU1MTEyMTU0YmE3MmZhYTlkZmRmYTYzNGRiNzEzNjViN2YyN2Q0
14
+ YzlmMWMwZGNiNGE1ZGIyOTc2OGM2YzFlNWJlNTZlNTlkNDk5ZDVhNTBiMzI2
15
+ NTg1NjhhN2VkNGVjNTRhMmJiYTMxNzhmODBhODhkODQzY2QyNDk=
@@ -95,36 +95,33 @@ module Kubeclient
95
95
 
96
96
  end
97
97
 
98
- unless entity == 'Node' #nodes don't support create/update right now via REST api
99
- define_method("create_#{entity.underscore}") do |entity_config|
100
- #to_hash should be called because of issue #9 in recursive open struct
101
- hash = entity_config.to_hash
102
- #keys should be renamed from underscore to k8s json naming style (camelized w first word lowercase)
103
- hash = rename_keys(hash, "camelize", :lower)
104
- begin
105
- rest_client[entity.pluralize.camelize(:lower)].post(hash.to_json)
106
- rescue RestClient::Exception => e
107
- exception = KubeException.new(e.http_code, JSON.parse(e.response)['message'] )
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
- define_method("update_#{entity.underscore}") do |entity_config|
113
- id = entity_config.id
114
- #to_hash should be called because of issue #9 in recursive open struct
115
- hash = entity_config.to_hash
116
- #temporary solution to delete id till this issue is solved: https://github.com/GoogleCloudPlatform/kubernetes/issues/3085
117
- hash.delete(:id)
118
- #keys should be renamed from underscore to k8s json naming style (camelized w first word lowercase)
119
- hash = rename_keys(hash, "camelize", :lower)
120
- begin
121
- rest_client[entity.underscore.pluralize+"/#{id}"].put(hash.to_json)
122
- rescue RestClient::Exception => e
123
- exception = KubeException.new(e.http_code, JSON.parse(e.response)['message'] )
124
- raise exception
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
@@ -1,3 +1,3 @@
1
1
  module Kubeclient
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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.5
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-08 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler