biosphere 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/biosphere/kube.rb +17 -1
- data/lib/biosphere/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39c9987b17ef9850602f0d6e68c8002a8b64d842
|
4
|
+
data.tar.gz: 4c463b3c39668f2329a9820d2645a6443a0ce38f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7959a09eb3d179d78ae78cc7319885decf77ae57fa31d512e446ff5d6c594abecef8a0e0eb5af6085c5bcf13001fbf80466ab0a7d21cee92bcc8ccd5fa09b8e1
|
7
|
+
data.tar.gz: 4d507b41a170ed80f9a0a986144b2928991d87fe587f0c60fae3f9bd6c5ed739f1e79ef854cd42e4403097b9d89140b8157f660cfffca28ccde77cbca1d9db6d
|
data/lib/biosphere/kube.rb
CHANGED
@@ -71,7 +71,23 @@ class Biosphere
|
|
71
71
|
end
|
72
72
|
|
73
73
|
ns_prefix = client.build_namespace_prefix(resource[:metadata][:namespace])
|
74
|
-
|
74
|
+
begin
|
75
|
+
ret = client.rest_client[ns_prefix + resource_name].post(resource.to_h.to_json, { 'Content-Type' => 'application/json' }.merge(client.instance_variable_get("@headers")))
|
76
|
+
rescue RestClient::MethodNotAllowed => e
|
77
|
+
if !resource[:metadata][:namespace]
|
78
|
+
puts "Error doing api call: #{e}".colorize(:red)
|
79
|
+
puts "This might be because you did not specify namespace in your resource: #{resource[:metadata]}".colorize(:yellow)
|
80
|
+
else
|
81
|
+
puts "Error calling API: #{e}"
|
82
|
+
end
|
83
|
+
puts "rest_client: #{ns_prefix + resource_name}, client: #{client.rest_client[ns_prefix + resource_name]}"
|
84
|
+
raise e
|
85
|
+
|
86
|
+
rescue RestClient::Exception => e
|
87
|
+
puts "Error calling API: #{e}"
|
88
|
+
puts "rest_client: #{ns_prefix + resource_name}, client: #{client.rest_client[ns_prefix + resource_name]}"
|
89
|
+
raise e
|
90
|
+
end
|
75
91
|
return {
|
76
92
|
action: :post,
|
77
93
|
resource: ns_prefix + resource_name + "/#{name}",
|
data/lib/biosphere/version.rb
CHANGED