fog-kubevirt 1.3.4 → 1.3.7

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
  SHA256:
3
- metadata.gz: 25e403e8a8bffea6ae2d48104dc39d7b98acfdc4af0b1484ab569060d6e2df45
4
- data.tar.gz: abd04bab68de9a88916e7b534050643beea7c6305b4647cc746e5cc971fb252c
3
+ metadata.gz: 57c10d7e3e9cf5cb70626ab8157c3a2f562ed9f508eeda6626df9214271e6184
4
+ data.tar.gz: 466642cb5d2de4786f9d937b8a9f345efd20eb949a9ecc16e54d1838bda24fee
5
5
  SHA512:
6
- metadata.gz: f599a11c355c7cf59272f6773976bbdeb164cdb4e4c61202805e79b595475330fcfc57eb38177e45d2b129761436b6924a8ab101d7551a838870e11830335eff
7
- data.tar.gz: 26e460f286f1e07d58b51105df89dba62ccbd39163e219938b1256e686e49ba61c15cf69562c418ed23f9a1b24bbedec2b2887940c05182d0c8bd0aee534af2a
6
+ metadata.gz: 8a95e033a9af266409f96be809c530bad1d11074046561e79a529313962a1aac4d968ae0b75058b0aea232e995379cde9daf522b55d7a95b8023e25b7e910d01
7
+ data.tar.gz: 81684ff5ee8008a6adf281c8d34dd7c0c85411afddd7bd8d1417419e330ae1ce11d368fa86b5334e4027856fe77910fe4038f2546da6dc5be521a086a6c789ab
@@ -148,6 +148,11 @@ module Fog
148
148
  #
149
149
  STORAGE_GROUP = 'storage.k8s.io'.freeze
150
150
 
151
+ #
152
+ # The API group of the Openshift Templates extension:
153
+ #
154
+ TEMPLATE_GROUP = 'template.openshift.io'.freeze
155
+
151
156
  def initialize(options={})
152
157
  require 'kubeclient'
153
158
 
@@ -285,7 +290,7 @@ module Fog
285
290
  populate_notice_attributes(template, notice)
286
291
  template
287
292
  end
288
- watch = openshift_client.watch_templates(opts)
293
+ watch = openshift_template_client.watch_templates(opts)
289
294
 
290
295
  WatchWrapper.new(watch, mapper)
291
296
  end
@@ -431,8 +436,8 @@ module Fog
431
436
  version
432
437
  end
433
438
 
434
- def openshift_client
435
- create_client('/oapi')
439
+ def openshift_template_client
440
+ create_client('/apis/' + TEMPLATE_GROUP)
436
441
  end
437
442
 
438
443
  def kube_client
@@ -455,6 +460,10 @@ module Fog
455
460
  @log
456
461
  end
457
462
 
463
+ def cert_expired?(cert)
464
+ Time.now > cert.not_after
465
+ end
466
+
458
467
  #
459
468
  # Prepare the TLS and authentication options that will be used for the
460
469
  # standard Kubernetes API and also for the KubeVirt extension
@@ -472,6 +481,7 @@ module Fog
472
481
 
473
482
  cert_store = OpenSSL::X509::Store.new
474
483
  certs.each do |cert|
484
+ raise ::Fog::Kubevirt::Errors::ValidationError, "Certificate has been expired" if cert_expired?(cert)
475
485
  cert_store.add_cert(cert)
476
486
  end
477
487
 
@@ -12,12 +12,16 @@ module Fog
12
12
  def all(filters = {})
13
13
  begin
14
14
  srvs = service.list_services(filters)
15
+
16
+ @kind = srvs.kind
17
+ @resource_version = srvs.resource_version
15
18
  rescue ::Fog::Kubevirt::Errors::ClientError
16
19
  # we assume that we get 404
17
20
  srvs = []
21
+
22
+ @kind = 'Service'
18
23
  end
19
- @kind = srvs.kind
20
- @resource_version = srvs.resource_version
24
+
21
25
  load srvs
22
26
  end
23
27
 
@@ -12,12 +12,16 @@ module Fog
12
12
  def all(filters = {})
13
13
  begin
14
14
  temps = service.list_templates(filters)
15
+
16
+ @kind = temps.kind
17
+ @resource_version = temps.resource_version
15
18
  rescue ::Fog::Kubevirt::Errors::ClientError
16
19
  # we assume that we get 404
17
20
  temps = []
21
+
22
+ @kind = 'Template'
18
23
  end
19
- @kind = temps.kind
20
- @resource_version = temps.resource_version
24
+
21
25
  load temps
22
26
  end
23
27
 
@@ -12,12 +12,16 @@ module Fog
12
12
  def all(filters = {})
13
13
  begin
14
14
  vms = service.list_vminstances(filters)
15
+
16
+ @kind = vms.kind
17
+ @resource_version = vms.resource_version
15
18
  rescue ::Fog::Kubevirt::Errors::ClientError
16
19
  # we assume that we get 404
17
20
  vms = []
21
+
22
+ @kind = 'VirtualMachineInstance'
18
23
  end
19
- @kind = vms.kind
20
- @resource_version = vms.resource_version
24
+
21
25
  load vms
22
26
  end
23
27
 
@@ -14,12 +14,16 @@ module Fog
14
14
  def all(filters = {})
15
15
  begin
16
16
  vms = service.list_vms(filters)
17
+
18
+ @kind = vms.kind
19
+ @resource_version = vms.resource_version
17
20
  rescue ::Fog::Kubevirt::Errors::ClientError
18
21
  # we assume that we get 404
19
22
  vms = []
23
+
24
+ @kind = 'VirtualMachine'
20
25
  end
21
- @kind = vms.kind
22
- @resource_version = vms.resource_version
26
+
23
27
  load vms
24
28
  end
25
29
 
@@ -3,7 +3,7 @@ module Fog
3
3
  class Compute
4
4
  class Real
5
5
  def get_template(name)
6
- Template.parse object_to_hash( openshift_client.get_template(name, @namespace) )
6
+ Template.parse object_to_hash( openshift_template_client.get_template(name, @namespace) )
7
7
  end
8
8
  end
9
9
 
@@ -5,7 +5,7 @@ module Fog
5
5
  class Compute
6
6
  class Real
7
7
  def list_templates(_filters = {})
8
- temps = openshift_client.get_templates(namespace: @namespace)
8
+ temps = openshift_template_client.get_templates(namespace: @namespace)
9
9
  entities = temps.map do |kubevirt_obj|
10
10
  Template.parse object_to_hash(kubevirt_obj)
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Kubevirt
3
- VERSION = '1.3.4'
3
+ VERSION = '1.3.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-kubevirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Kliczewski
@@ -11,11 +11,13 @@ authors:
11
11
  - Adam Grare
12
12
  - Boris Odnopozov
13
13
  - Shira Maximov
14
+ - yifatmakias
15
+ - Beni Cherniavsky-Paskin
14
16
  - Wesley Beary
15
- autorequire:
17
+ autorequire:
16
18
  bindir: bin
17
19
  cert_chain: []
18
- date: 2020-05-10 00:00:00.000000000 Z
20
+ date: 2022-05-11 00:00:00.000000000 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  name: minitest
@@ -119,25 +121,33 @@ dependencies:
119
121
  name: kubeclient
120
122
  requirement: !ruby/object:Gem::Requirement
121
123
  requirements:
122
- - - "~>"
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 4.9.3
127
+ - - "<"
123
128
  - !ruby/object:Gem::Version
124
- version: '4.3'
129
+ version: 5.0.0
125
130
  type: :runtime
126
131
  prerelease: false
127
132
  version_requirements: !ruby/object:Gem::Requirement
128
133
  requirements:
129
- - - "~>"
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: 4.9.3
137
+ - - "<"
130
138
  - !ruby/object:Gem::Version
131
- version: '4.3'
139
+ version: 5.0.0
132
140
  description: This library can be used as a module for `fog`.
133
141
  email:
134
142
  - piotr.kliczewski@gmail.com
135
143
  - masayag@redhat.com
136
144
  - plribeiro3000@gmail.com
137
145
  - gilles@redhat.com
138
- - agrare@redhat.com
146
+ - adam@grare.com
139
147
  - bodnopoz@redhat.com
140
148
  - shiramaximov@gmail.com
149
+ - ymakias@redhat.com
150
+ - cben@redhat.com
141
151
  - geemus@gmail.com
142
152
  executables: []
143
153
  extensions: []
@@ -244,7 +254,7 @@ homepage: https://github.com/fog/fog-kubevirt
244
254
  licenses:
245
255
  - Apache-2.0
246
256
  metadata: {}
247
- post_install_message:
257
+ post_install_message:
248
258
  rdoc_options: []
249
259
  require_paths:
250
260
  - lib
@@ -259,8 +269,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
269
  - !ruby/object:Gem::Version
260
270
  version: '0'
261
271
  requirements: []
262
- rubygems_version: 3.0.3
263
- signing_key:
272
+ rubygems_version: 3.1.6
273
+ signing_key:
264
274
  specification_version: 4
265
275
  summary: Module for the 'fog' gem to support Kubevirt.
266
276
  test_files: