k8s-client 0.10.0 → 0.10.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
  SHA1:
3
- metadata.gz: fe5285594d28e6f112fe34e988cbd981c1cba982
4
- data.tar.gz: 62512ffc4b9619d55a1b944bfd2c7d22ef5ba9a3
3
+ metadata.gz: 0dedb2fd79d6cda566ceed2be82517ea27ebf875
4
+ data.tar.gz: c94eab8eadd2a03b96a13ea58fbbfd57eab5dc32
5
5
  SHA512:
6
- metadata.gz: 02e79f42d225490c54aeb855f526cd3ddbcb71a5e266c1438734ae7839fc2716a7eadf0f44b556279a69d38acb9fe6037a98f5b7bbf16ba165a50467afa21e5b
7
- data.tar.gz: 534208a895291ebac3d6f831db8513c85f52a73396689be0e254568913cc6bfa527e212b198ae52109e444873469b2a5dfc24298ce9ed528b3d3e5e434e1045a
6
+ metadata.gz: 4384ae875722d504b6c8e9415b7c069031cdf79b0f66ff8d159795bd09338f421d34b6e05f87f47153ae57b43fae7e2e5a4c78bea78fd9f43c50a8f90f150dec
7
+ data.tar.gz: 97c05e8f1956a377f30d31c2f65b11db96fc9544212f3f7213c8f280db2684ca3766a33232c90545172accaa940a8e7b67bee41a7d115628f3cabf25ccde6efb
@@ -3,6 +3,6 @@
3
3
  module K8s
4
4
  class Client
5
5
  # Updated on releases using semver.
6
- VERSION = "0.10.0"
6
+ VERSION = "0.10.1"
7
7
  end
8
8
  end
@@ -0,0 +1,33 @@
1
+ apiVersion: v1
2
+ kind: Pod
3
+ metadata:
4
+ name: myapp
5
+ spec:
6
+ containers:
7
+ - name: myapp
8
+ image: docker.io/nginx/:1-alpine
9
+ resources:
10
+ limits:
11
+ memory: "10Mi"
12
+ cpu: "100m"
13
+
14
+ ---
15
+
16
+ apiVersion: v1
17
+ kind: Pod
18
+ metadata:
19
+ name: myapp
20
+ labels: {}
21
+ spec:
22
+ containers:
23
+ - name: myapp
24
+ image: docker.io/nginx/:1-alpine
25
+ resources:
26
+ limits:
27
+ memory: "10Mi"
28
+ cpu: "100m"
29
+ ports: []
30
+
31
+
32
+
33
+
@@ -101,7 +101,7 @@ module K8s
101
101
  if !server_resource
102
102
  logger.info "Create resource #{resource.apiVersion}:#{resource.kind}/#{resource.metadata.name} in namespace #{resource.metadata.namespace} with checksum=#{resource.checksum}"
103
103
  keep_resource! client.create_resource(prepare_resource(resource))
104
- elsif server_resource.metadata.annotations[@checksum_annotation] != resource.checksum
104
+ elsif server_resource.metadata.annotations&.dig(@checksum_annotation) != resource.checksum
105
105
  logger.info "Update resource #{resource.apiVersion}:#{resource.kind}/#{resource.metadata.name} in namespace #{resource.metadata.namespace} with checksum=#{resource.checksum}"
106
106
  r = prepare_resource(resource)
107
107
  if server_resource.can_patch?(@last_config_annotation)
@@ -231,7 +231,7 @@ module K8s
231
231
  def parse_response(response, request_options, response_class: nil)
232
232
  method = request_options[:method]
233
233
  path = request_options[:path]
234
- content_type, = response.headers['Content-Type'].split(';')
234
+ content_type = response.headers['Content-Type']&.split(';', 2)&.first
235
235
 
236
236
  case content_type
237
237
  when 'application/json'
@@ -240,7 +240,7 @@ module K8s
240
240
  when 'text/plain'
241
241
  response_data = response.body # XXX: broken if status 2xx
242
242
  else
243
- raise K8s::Error::API.new(method, path, response.status, "Invalid response Content-Type: #{response.headers['Content-Type']}")
243
+ raise K8s::Error::API.new(method, path, response.status, "Invalid response Content-Type: #{response.headers['Content-Type'].inspect}")
244
244
  end
245
245
 
246
246
  if response.status.between? 200, 299
@@ -352,7 +352,7 @@ module K8s
352
352
 
353
353
  # @return [Boolean] true if delete options should be sent as bode of the DELETE request
354
354
  def need_delete_body?
355
- @need_delete_body ||= Gem::Version.new(version.gitVersion.match(/v*(.*)/)[1]) < DELETE_OPTS_BODY_VERSION_MIN
355
+ @need_delete_body ||= Gem::Version.new(version.gitVersion.match(/^v*((\d|\.)*)/)[1]) < DELETE_OPTS_BODY_VERSION_MIN
356
356
  end
357
357
 
358
358
  # @param path [Array<String>] @see #path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k8s-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -233,6 +233,7 @@ files:
233
233
  - lib/k8s/client/version.rb
234
234
  - lib/k8s/config.rb
235
235
  - lib/k8s/error.rb
236
+ - lib/k8s/foo.yaml
236
237
  - lib/k8s/logging.rb
237
238
  - lib/k8s/resource.rb
238
239
  - lib/k8s/resource_client.rb