fog-kubevirt 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog/kubevirt/compute/compute.rb +125 -37
- data/lib/fog/kubevirt/compute/models/networkattachmentdef.rb +25 -0
- data/lib/fog/kubevirt/compute/models/networkattachmentdefs.rb +59 -0
- data/lib/fog/kubevirt/compute/models/pvc.rb +59 -0
- data/lib/fog/kubevirt/compute/models/pvcs.rb +76 -0
- data/lib/fog/kubevirt/compute/models/server.rb +42 -0
- data/lib/fog/kubevirt/compute/models/servers.rb +32 -0
- data/lib/fog/kubevirt/compute/models/service.rb +36 -0
- data/lib/fog/kubevirt/compute/models/services.rb +83 -0
- data/lib/fog/kubevirt/compute/models/vm.rb +6 -60
- data/lib/fog/kubevirt/compute/models/vm_base.rb +75 -0
- data/lib/fog/kubevirt/compute/models/vm_data.rb +164 -0
- data/lib/fog/kubevirt/compute/models/vms.rb +59 -19
- data/lib/fog/kubevirt/compute/models/volume.rb +73 -0
- data/lib/fog/kubevirt/compute/models/volumes.rb +61 -0
- data/lib/fog/kubevirt/compute/requests/create_networkattachmentdef.rb +37 -0
- data/lib/fog/kubevirt/compute/requests/create_service.rb +18 -0
- data/lib/fog/kubevirt/compute/requests/create_vm.rb +2 -0
- data/lib/fog/kubevirt/compute/requests/create_volume.rb +19 -0
- data/lib/fog/kubevirt/compute/requests/delete_networkattachmentdef.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/delete_pvc.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/delete_service.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/delete_volume.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/get_networkattachmentdef.rb +19 -0
- data/lib/fog/kubevirt/compute/requests/get_pvc.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/get_server.rb +32 -0
- data/lib/fog/kubevirt/compute/requests/get_service.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/get_vm.rb +1 -1
- data/lib/fog/kubevirt/compute/requests/get_vminstance.rb +4 -4
- data/lib/fog/kubevirt/compute/requests/get_volume.rb +16 -0
- data/lib/fog/kubevirt/compute/requests/list_networkattachmentdefs.rb +21 -0
- data/lib/fog/kubevirt/compute/requests/list_pvcs.rb +22 -0
- data/lib/fog/kubevirt/compute/requests/list_servers.rb +25 -0
- data/lib/fog/kubevirt/compute/requests/list_services.rb +22 -0
- data/lib/fog/kubevirt/compute/requests/list_vms.rb +4 -4
- data/lib/fog/kubevirt/compute/requests/list_volumes.rb +22 -0
- data/lib/fog/kubevirt/version.rb +1 -1
- data/spec/compute_v1alpha2_spec.rb +30 -0
- data/spec/fixtures/kubevirt/networkattachmentdefinition/networkattachmentdefinitions_crud.yml +320 -0
- data/spec/fixtures/kubevirt/pvc/pvcs_crud.yml +316 -0
- data/spec/fixtures/kubevirt/service/services_crud.yml +316 -0
- data/spec/fixtures/kubevirt/volume/volumes_crud.yml +316 -0
- data/spec/network_attachment_definition_v1alpha2_spec.rb +28 -0
- data/spec/pvcs_v1alpha2_spec.rb +52 -0
- data/spec/shared_context.rb +53 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/volumes_v1alpha2_spec.rb +45 -0
- metadata +87 -10
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require_relative './shared_context'
|
3
|
+
|
4
|
+
require 'fog/kubevirt'
|
5
|
+
|
6
|
+
describe Fog::Kubevirt::Compute do
|
7
|
+
before :all do
|
8
|
+
vcr = KubevirtVCR.new(
|
9
|
+
vcr_directory: 'spec/fixtures/kubevirt/volume',
|
10
|
+
service_class: Fog::Kubevirt::Compute
|
11
|
+
)
|
12
|
+
@service = vcr.service
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'CRUD services' do
|
16
|
+
VCR.use_cassette('volumes_crud') do
|
17
|
+
begin
|
18
|
+
name = 'my-local-storage'
|
19
|
+
access_modes = [ 'ReadWriteOnce' ]
|
20
|
+
capacity = '1Gi'
|
21
|
+
labels = { type: 'local' }
|
22
|
+
storage_class = 'manual'
|
23
|
+
type = 'hostPath'
|
24
|
+
config = { path: "/mnt/data/datax", type: "Directory" }
|
25
|
+
|
26
|
+
@service.volumes.create(name: name,
|
27
|
+
access_modes: access_modes,
|
28
|
+
capacity: capacity,
|
29
|
+
labels: labels,
|
30
|
+
storage_class: storage_class,
|
31
|
+
type: type,
|
32
|
+
config: config)
|
33
|
+
|
34
|
+
volume = @service.volumes.get(name)
|
35
|
+
assert_equal(volume.name, 'my-local-storage')
|
36
|
+
assert_equal(volume.access_modes, [ 'ReadWriteOnce' ])
|
37
|
+
assert_equal(volume.capacity, '1Gi')
|
38
|
+
assert_equal(volume.storage_class, 'manual')
|
39
|
+
assert_equal(volume.type, 'hostPath')
|
40
|
+
ensure
|
41
|
+
@service.volumes.delete(name) if volume
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-kubevirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Kliczewski
|
8
8
|
- Moti Asayag
|
9
9
|
- Paulo Ribeiro
|
10
10
|
- Gilles Dubreuil
|
11
|
+
- Adam Grare
|
11
12
|
- Wesley Beary
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
|
-
date:
|
16
|
+
date: 2019-02-27 00:00:00.000000000 Z
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|
18
|
-
name:
|
19
|
+
name: minitest
|
19
20
|
requirement: !ruby/object:Gem::Requirement
|
20
21
|
requirements:
|
21
|
-
- - "
|
22
|
+
- - ">="
|
22
23
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
24
|
+
version: '0'
|
24
25
|
type: :development
|
25
26
|
prerelease: false
|
26
27
|
version_requirements: !ruby/object:Gem::Requirement
|
27
28
|
requirements:
|
28
|
-
- - "
|
29
|
+
- - ">="
|
29
30
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
31
|
+
version: '0'
|
31
32
|
- !ruby/object:Gem::Dependency
|
32
33
|
name: rake
|
33
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,6 +71,34 @@ dependencies:
|
|
70
71
|
- - ">="
|
71
72
|
- !ruby/object:Gem::Version
|
72
73
|
version: '0'
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: vcr
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
type: :development
|
82
|
+
prerelease: false
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: webmock
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
type: :development
|
96
|
+
prerelease: false
|
97
|
+
version_requirements: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
73
102
|
- !ruby/object:Gem::Dependency
|
74
103
|
name: fog-core
|
75
104
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,20 +119,21 @@ dependencies:
|
|
90
119
|
requirements:
|
91
120
|
- - "~>"
|
92
121
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
122
|
+
version: 4.1.2
|
94
123
|
type: :runtime
|
95
124
|
prerelease: false
|
96
125
|
version_requirements: !ruby/object:Gem::Requirement
|
97
126
|
requirements:
|
98
127
|
- - "~>"
|
99
128
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
129
|
+
version: 4.1.2
|
101
130
|
description: This library can be used as a module for `fog`.
|
102
131
|
email:
|
103
132
|
- piotr.kliczewski@gmail.com
|
104
133
|
- masayag@redhat.com
|
105
134
|
- plribeiro3000@gmail.com
|
106
135
|
- gilles@redhat.com
|
136
|
+
- agrare@redhat.com
|
107
137
|
- geemus@gmail.com
|
108
138
|
executables: []
|
109
139
|
extensions: []
|
@@ -114,31 +144,68 @@ files:
|
|
114
144
|
- lib/fog/bin/kubevirt.rb
|
115
145
|
- lib/fog/kubevirt.rb
|
116
146
|
- lib/fog/kubevirt/compute/compute.rb
|
147
|
+
- lib/fog/kubevirt/compute/models/networkattachmentdef.rb
|
148
|
+
- lib/fog/kubevirt/compute/models/networkattachmentdefs.rb
|
117
149
|
- lib/fog/kubevirt/compute/models/node.rb
|
118
150
|
- lib/fog/kubevirt/compute/models/nodes.rb
|
151
|
+
- lib/fog/kubevirt/compute/models/pvc.rb
|
152
|
+
- lib/fog/kubevirt/compute/models/pvcs.rb
|
153
|
+
- lib/fog/kubevirt/compute/models/server.rb
|
154
|
+
- lib/fog/kubevirt/compute/models/servers.rb
|
155
|
+
- lib/fog/kubevirt/compute/models/service.rb
|
156
|
+
- lib/fog/kubevirt/compute/models/services.rb
|
119
157
|
- lib/fog/kubevirt/compute/models/template.rb
|
120
158
|
- lib/fog/kubevirt/compute/models/templates.rb
|
121
159
|
- lib/fog/kubevirt/compute/models/vm.rb
|
160
|
+
- lib/fog/kubevirt/compute/models/vm_base.rb
|
161
|
+
- lib/fog/kubevirt/compute/models/vm_data.rb
|
122
162
|
- lib/fog/kubevirt/compute/models/vminstance.rb
|
123
163
|
- lib/fog/kubevirt/compute/models/vminstances.rb
|
124
164
|
- lib/fog/kubevirt/compute/models/vms.rb
|
125
165
|
- lib/fog/kubevirt/compute/models/volume.rb
|
126
166
|
- lib/fog/kubevirt/compute/models/volumes.rb
|
167
|
+
- lib/fog/kubevirt/compute/requests/create_networkattachmentdef.rb
|
127
168
|
- lib/fog/kubevirt/compute/requests/create_pvc.rb
|
169
|
+
- lib/fog/kubevirt/compute/requests/create_service.rb
|
128
170
|
- lib/fog/kubevirt/compute/requests/create_vm.rb
|
129
171
|
- lib/fog/kubevirt/compute/requests/create_vminstance.rb
|
172
|
+
- lib/fog/kubevirt/compute/requests/create_volume.rb
|
173
|
+
- lib/fog/kubevirt/compute/requests/delete_networkattachmentdef.rb
|
174
|
+
- lib/fog/kubevirt/compute/requests/delete_pvc.rb
|
175
|
+
- lib/fog/kubevirt/compute/requests/delete_service.rb
|
130
176
|
- lib/fog/kubevirt/compute/requests/delete_vm.rb
|
131
177
|
- lib/fog/kubevirt/compute/requests/delete_vminstance.rb
|
178
|
+
- lib/fog/kubevirt/compute/requests/delete_volume.rb
|
179
|
+
- lib/fog/kubevirt/compute/requests/get_networkattachmentdef.rb
|
132
180
|
- lib/fog/kubevirt/compute/requests/get_node.rb
|
181
|
+
- lib/fog/kubevirt/compute/requests/get_pvc.rb
|
182
|
+
- lib/fog/kubevirt/compute/requests/get_server.rb
|
183
|
+
- lib/fog/kubevirt/compute/requests/get_service.rb
|
133
184
|
- lib/fog/kubevirt/compute/requests/get_template.rb
|
134
185
|
- lib/fog/kubevirt/compute/requests/get_vm.rb
|
135
186
|
- lib/fog/kubevirt/compute/requests/get_vminstance.rb
|
187
|
+
- lib/fog/kubevirt/compute/requests/get_volume.rb
|
188
|
+
- lib/fog/kubevirt/compute/requests/list_networkattachmentdefs.rb
|
136
189
|
- lib/fog/kubevirt/compute/requests/list_nodes.rb
|
190
|
+
- lib/fog/kubevirt/compute/requests/list_pvcs.rb
|
191
|
+
- lib/fog/kubevirt/compute/requests/list_servers.rb
|
192
|
+
- lib/fog/kubevirt/compute/requests/list_services.rb
|
137
193
|
- lib/fog/kubevirt/compute/requests/list_templates.rb
|
138
194
|
- lib/fog/kubevirt/compute/requests/list_vminstances.rb
|
139
195
|
- lib/fog/kubevirt/compute/requests/list_vms.rb
|
196
|
+
- lib/fog/kubevirt/compute/requests/list_volumes.rb
|
140
197
|
- lib/fog/kubevirt/compute/requests/update_vm.rb
|
141
198
|
- lib/fog/kubevirt/version.rb
|
199
|
+
- spec/compute_v1alpha2_spec.rb
|
200
|
+
- spec/fixtures/kubevirt/networkattachmentdefinition/networkattachmentdefinitions_crud.yml
|
201
|
+
- spec/fixtures/kubevirt/pvc/pvcs_crud.yml
|
202
|
+
- spec/fixtures/kubevirt/service/services_crud.yml
|
203
|
+
- spec/fixtures/kubevirt/volume/volumes_crud.yml
|
204
|
+
- spec/network_attachment_definition_v1alpha2_spec.rb
|
205
|
+
- spec/pvcs_v1alpha2_spec.rb
|
206
|
+
- spec/shared_context.rb
|
207
|
+
- spec/spec_helper.rb
|
208
|
+
- spec/volumes_v1alpha2_spec.rb
|
142
209
|
homepage: https://github.com/pkliczewski/fog-kubevirt
|
143
210
|
licenses:
|
144
211
|
- Apache-2.0
|
@@ -163,4 +230,14 @@ rubygems_version: 2.6.14
|
|
163
230
|
signing_key:
|
164
231
|
specification_version: 4
|
165
232
|
summary: Module for the 'fog' gem to support Kubevirt.
|
166
|
-
test_files:
|
233
|
+
test_files:
|
234
|
+
- spec/compute_v1alpha2_spec.rb
|
235
|
+
- spec/fixtures/kubevirt/networkattachmentdefinition/networkattachmentdefinitions_crud.yml
|
236
|
+
- spec/fixtures/kubevirt/pvc/pvcs_crud.yml
|
237
|
+
- spec/fixtures/kubevirt/service/services_crud.yml
|
238
|
+
- spec/fixtures/kubevirt/volume/volumes_crud.yml
|
239
|
+
- spec/network_attachment_definition_v1alpha2_spec.rb
|
240
|
+
- spec/pvcs_v1alpha2_spec.rb
|
241
|
+
- spec/shared_context.rb
|
242
|
+
- spec/spec_helper.rb
|
243
|
+
- spec/volumes_v1alpha2_spec.rb
|