fog-kubevirt 0.3.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/lib/fog/bin/kubevirt.rb +2 -2
  4. data/lib/fog/kubevirt.rb +1 -4
  5. data/lib/fog/{compute/kubevirt.rb → kubevirt/compute/compute.rb} +35 -184
  6. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/node.rb +3 -3
  7. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/nodes.rb +4 -4
  8. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/template.rb +2 -2
  9. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/templates.rb +4 -4
  10. data/lib/fog/kubevirt/compute/models/vm.rb +71 -0
  11. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/vminstance.rb +4 -13
  12. data/lib/fog/{compute/kubevirt → kubevirt/compute}/models/vminstances.rb +4 -4
  13. data/lib/fog/kubevirt/compute/models/vms.rb +137 -0
  14. data/lib/fog/kubevirt/compute/models/volume.rb +9 -0
  15. data/lib/fog/kubevirt/compute/models/volumes.rb +12 -0
  16. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/create_pvc.rb +2 -2
  17. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/create_vm.rb +2 -3
  18. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/create_vminstance.rb +2 -2
  19. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/delete_vm.rb +3 -3
  20. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/delete_vminstance.rb +5 -5
  21. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/get_node.rb +2 -2
  22. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/get_template.rb +2 -2
  23. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/get_vm.rb +3 -3
  24. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/get_vminstance.rb +6 -6
  25. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/list_nodes.rb +2 -2
  26. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/list_templates.rb +2 -2
  27. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/list_vminstances.rb +2 -2
  28. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/list_vms.rb +6 -6
  29. data/lib/fog/{compute/kubevirt → kubevirt/compute}/requests/update_vm.rb +2 -2
  30. data/lib/fog/kubevirt/version.rb +1 -1
  31. metadata +39 -133
  32. data/lib/fog/compute/kubevirt/models/networkattachmentdef.rb +0 -25
  33. data/lib/fog/compute/kubevirt/models/networkattachmentdefs.rb +0 -59
  34. data/lib/fog/compute/kubevirt/models/persistentvolume.rb +0 -82
  35. data/lib/fog/compute/kubevirt/models/persistentvolumes.rb +0 -73
  36. data/lib/fog/compute/kubevirt/models/pvc.rb +0 -59
  37. data/lib/fog/compute/kubevirt/models/pvcs.rb +0 -76
  38. data/lib/fog/compute/kubevirt/models/server.rb +0 -44
  39. data/lib/fog/compute/kubevirt/models/servers.rb +0 -32
  40. data/lib/fog/compute/kubevirt/models/service.rb +0 -36
  41. data/lib/fog/compute/kubevirt/models/services.rb +0 -83
  42. data/lib/fog/compute/kubevirt/models/storageclass.rb +0 -33
  43. data/lib/fog/compute/kubevirt/models/storageclasses.rb +0 -61
  44. data/lib/fog/compute/kubevirt/models/vm.rb +0 -17
  45. data/lib/fog/compute/kubevirt/models/vm_base.rb +0 -86
  46. data/lib/fog/compute/kubevirt/models/vm_data.rb +0 -162
  47. data/lib/fog/compute/kubevirt/models/vms.rb +0 -206
  48. data/lib/fog/compute/kubevirt/models/volume.rb +0 -57
  49. data/lib/fog/compute/kubevirt/models/volumes.rb +0 -18
  50. data/lib/fog/compute/kubevirt/requests/create_networkattachmentdef.rb +0 -37
  51. data/lib/fog/compute/kubevirt/requests/create_persistentvolume.rb +0 -19
  52. data/lib/fog/compute/kubevirt/requests/create_service.rb +0 -18
  53. data/lib/fog/compute/kubevirt/requests/create_storageclass.rb +0 -18
  54. data/lib/fog/compute/kubevirt/requests/delete_networkattachmentdef.rb +0 -16
  55. data/lib/fog/compute/kubevirt/requests/delete_persistentvolume.rb +0 -16
  56. data/lib/fog/compute/kubevirt/requests/delete_pvc.rb +0 -16
  57. data/lib/fog/compute/kubevirt/requests/delete_service.rb +0 -16
  58. data/lib/fog/compute/kubevirt/requests/delete_storageclass.rb +0 -16
  59. data/lib/fog/compute/kubevirt/requests/get_networkattachmentdef.rb +0 -19
  60. data/lib/fog/compute/kubevirt/requests/get_persistentvolume.rb +0 -16
  61. data/lib/fog/compute/kubevirt/requests/get_pvc.rb +0 -16
  62. data/lib/fog/compute/kubevirt/requests/get_server.rb +0 -32
  63. data/lib/fog/compute/kubevirt/requests/get_service.rb +0 -16
  64. data/lib/fog/compute/kubevirt/requests/get_storageclass.rb +0 -16
  65. data/lib/fog/compute/kubevirt/requests/list_networkattachmentdefs.rb +0 -21
  66. data/lib/fog/compute/kubevirt/requests/list_persistentvolumes.rb +0 -22
  67. data/lib/fog/compute/kubevirt/requests/list_pvcs.rb +0 -22
  68. data/lib/fog/compute/kubevirt/requests/list_servers.rb +0 -25
  69. data/lib/fog/compute/kubevirt/requests/list_services.rb +0 -22
  70. data/lib/fog/compute/kubevirt/requests/list_storageclasses.rb +0 -22
  71. data/lib/fog/compute/kubevirt/requests/list_volumes.rb +0 -30
  72. data/spec/compute_v1alpha2_spec.rb +0 -30
  73. data/spec/create_vm_spec.rb +0 -101
  74. data/spec/fixtures/kubevirt/networkattachmentdefinition/networkattachmentdefinitions_crud.yml +0 -320
  75. data/spec/fixtures/kubevirt/persistentvolume/persistent_volumes_crud.yml +0 -316
  76. data/spec/fixtures/kubevirt/pvc/pvcs_crud.yml +0 -362
  77. data/spec/fixtures/kubevirt/service/services_crud.yml +0 -316
  78. data/spec/fixtures/kubevirt/storageclass/storageclasses_crud.yml +0 -400
  79. data/spec/fixtures/kubevirt/vm/vm_create_multi.yml +0 -459
  80. data/spec/fixtures/kubevirt/vm/vm_create_single.yml +0 -362
  81. data/spec/network_attachment_definition_v1alpha2_spec.rb +0 -28
  82. data/spec/persistent_volumes_v1alpha2_spec.rb +0 -45
  83. data/spec/pvcs_v1alpha2_spec.rb +0 -59
  84. data/spec/shared_context.rb +0 -54
  85. data/spec/spec_helper.rb +0 -10
  86. data/spec/storage_classes_v1_spec.rb +0 -46
@@ -1,54 +0,0 @@
1
- require 'vcr'
2
-
3
- class KubevirtVCR
4
- attr_reader :service,
5
- :host,
6
- :port,
7
- :token
8
-
9
- def initialize(options)
10
- @vcr_directory = options[:vcr_directory]
11
- @service_class = options[:service_class]
12
-
13
- use_recorded = !ENV.key?('KUBE_HOST') || ENV['USE_VCR'] == 'true'
14
- if use_recorded
15
- Fog.interval = 0
16
- @host = "10.8.254.82"
17
- @port = "8443"
18
- else
19
- @host = ENV['KUBE_HOST']
20
- @port = ENV['KUBE_PORT']
21
- end
22
-
23
- VCR.configure do |config|
24
- config.allow_http_connections_when_no_cassette = true
25
- config.hook_into :webmock
26
-
27
- if use_recorded
28
- config.cassette_library_dir = ENV['SPEC_PATH'] || @vcr_directory
29
- config.default_cassette_options = {:record => :none}
30
- config.default_cassette_options.merge! :match_requests_on => %i[method uri body]
31
- else
32
- config.cassette_library_dir = "spec/debug"
33
- config.default_cassette_options = {:record => :all}
34
- end
35
- end
36
-
37
- VCR.use_cassette('common_setup') do
38
- @token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im15LWFjY291bnQtdG9rZW4ta3FsZDYiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibXktYWNjb3VudCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjJlYjVjZjU1LTFlNDUtMTFlOS1iYmZmLWZhMTYzZTM4OTEyYSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0Om15LWFjY291bnQifQ.aAigSXFZapxJdFy3FwgSNc77jZYFiSTlG7D_AnHzBT1ZP69xLmrqI_oXt73NDLpecNWezjIvsCU6sLf45tfPY2RQX_aEAOXKWjFs2SxWI7GeQ-sWRt0yd1sOB9R48ipTdpNpNs5pypnTRg6dYLvtePmBWyOSN2412F9XKeM79tuO9a_ynPDjkCwsWJXGj-gX9DwpHdGK-cup0YosJ-9OpvXoWOiUNeBi1KrvJxgQwgLytJk3PHFnJHv4mCNALvvo1cu89_ENwUQrvok267ACeq53YsivYn7B0QWuZoX3ca4Bx14kEdXbd-9BvIEBZzVovH2ZvPTYMmyXgnpO7c1eOw"
39
-
40
- unless use_recorded
41
- @token = ENV['KUBE_TOKEN'] || options[:token] || @token
42
- end
43
-
44
- connection_params = {
45
- provider: 'kubevirt',
46
- kubevirt_hostname: @host,
47
- kubevirt_port: @port,
48
- kubevirt_token: @token
49
- }
50
-
51
- @service = @service_class.new(connection_params)
52
- end
53
- end
54
- end
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'vcr'
3
- require 'fog/core'
4
- require 'fog/kubevirt'
5
-
6
- VCR.configure do |c|
7
- c.cassette_library_dir = 'spec/fixtures/kubevirt'
8
- c.hook_into :webmock
9
- c.debug_logger = nil # use $stderr to debug
10
- end
@@ -1,46 +0,0 @@
1
- require 'spec_helper'
2
- require_relative './shared_context'
3
-
4
- require 'fog/kubevirt'
5
-
6
- describe Fog::Compute do
7
- before :all do
8
- vcr = KubevirtVCR.new(
9
- vcr_directory: 'spec/fixtures/kubevirt/storageclass',
10
- service_class: Fog::Compute
11
- )
12
- @service = vcr.service
13
- end
14
-
15
- it 'CRUD services' do
16
- VCR.use_cassette('storageclasses_crud') do
17
- begin
18
- name = 'my-storage-class'
19
- parameters = {
20
- 'resturl' => 'http://heketi-storage.glusterfs.svc:8080',
21
- 'restuser' => 'admin',
22
- 'secretName' => 'heketi-storage-admin-secret',
23
- 'secretNamespace' => 'glusterfs'
24
- }
25
-
26
- provisioner = 'kubernetes.io/glusterfs'
27
- reclaim_policy = 'Delete'
28
- volume_binding_mode = 'Immediate'
29
-
30
- @service.storageclasses.create(name: name,
31
- parameters: parameters,
32
- provisioner: provisioner,
33
- reclaim_policy: reclaim_policy,
34
- volume_binding_mode: volume_binding_mode)
35
-
36
- storageclass = @service.storageclasses.get(name)
37
- assert_equal(storageclass.name, 'my-storage-class')
38
- assert_equal(storageclass.provisioner, 'kubernetes.io/glusterfs')
39
- assert_equal(storageclass.reclaim_policy, 'Delete')
40
- assert_equal(storageclass.volume_binding_mode, 'Immediate')
41
- ensure
42
- @service.storageclasses.delete(name) if storageclass
43
- end
44
- end
45
- end
46
- end