foreman_kubevirt 0.1.3 → 0.1.4

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
- SHA1:
3
- metadata.gz: 0e0ae0ca0c55da65290264cdf02df32185314908
4
- data.tar.gz: 12230c05d0f34969260ad7f3efaefb0486e094b9
2
+ SHA256:
3
+ metadata.gz: a96cfb40c1c6f9f54b17cb33fae6abffec9c0764d4c9bbdd5a17595e18e967f4
4
+ data.tar.gz: c5bd84ee5ef168cc16a63dab87e7a2d164880a8cd00a481023d8cc48dd06ad3c
5
5
  SHA512:
6
- metadata.gz: baf978d956388d8fccd84cb3e48c110b6a874542736ef6987a27c45732f9e807573ab6f87088b5a32fb46fa304c16e0a0f694965664314d8380a940dd720e4c5
7
- data.tar.gz: 46c7b84303561d9a5cc2db9f72d5896775604df20263ce590f3d29f415230903e75b6ab06211478f121c717522fbea7535d9ab984bc41e82c02e57f9ff5260a9
6
+ metadata.gz: db867f6014df1f71ad31a315559b266eaccf5d5f96e8267afa3fa88733c167c514d0dfcccc6030ee39d399760186a34d819b6bd18b8c26d705f17c529e85aaf9
7
+ data.tar.gz: 034ff8550502a7cdb2d205899b4a5394f7ef231b3938465fb15847338bcb965f5296669a9a9e254bbf116aae3a129721d12e1a78fa66f3d8ca8c2591a0cdf30a
@@ -0,0 +1 @@
1
+ window.tfm = { kubevirt: { require('./foreman_kubevirt/kubevirt.js') };
@@ -6,7 +6,7 @@ module ForemanKubevirt
6
6
  alias_attribute :token, :password
7
7
  alias_attribute :namespace, :user
8
8
  validates :hostname, :api_port, :namespace, :token, :presence => true
9
- validate :test_connection
9
+ before_save :test_connection
10
10
 
11
11
  def ca_cert
12
12
  attrs[:ca_cert]
@@ -53,6 +53,7 @@ module ForemanKubevirt
53
53
  end
54
54
 
55
55
  def test_connection(_options = {})
56
+ validate!
56
57
  client&.valid? && client&.virt_supported?
57
58
  rescue StandardError => e
58
59
  errors[:base] << e.message
@@ -1,7 +1,7 @@
1
- <%= text_f f, :hostname, :label => _("Hostname") %>
1
+ <%= text_f f, :hostname, :label => _("Hostname"), :required => true %>
2
2
  <%= text_f f, :api_port, :label => _("API Port"), :required => true %>
3
3
  <%= text_f f, :namespace, :label => _("Namespace"), :required => true %>
4
- <%= password_f f, :password, :label => _("Token"), :required => true,
4
+ <%= password_f f, :token, :label => _("Token"), :required => true,
5
5
  :keep_value => true, :unset => unset_password?,
6
6
  :help_block => _("e.g. eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..."),
7
7
  :help_inline => documentation_button('/foreman_kubevirt/0.x/index.html#4.1SettingComputeResourceTokenandX509CAvalues',
@@ -1,3 +1,3 @@
1
1
  module ForemanKubevirt
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
@@ -1,10 +1,10 @@
1
1
  FactoryBot.define do
2
2
  factory :compute_resource_kubevirt, class: 'ForemanKubevirt::Kubevirt' do
3
- provider "Kubevirt"
4
- name 'kubevirt-multus'
5
- hostname "192.168.111.13"
6
- api_port "6443"
7
- namespace "default"
8
- token "kubetoken"
3
+ provider { "Kubevirt" }
4
+ name { 'kubevirt-multus' }
5
+ hostname { "192.168.111.13" }
6
+ api_port { "6443" }
7
+ namespace { "default" }
8
+ token { "kubetoken" }
9
9
  end
10
10
  end
@@ -1,46 +1,46 @@
1
1
  FactoryBot.define do
2
2
  factory :host_kubevirt, class: 'Host::Managed' do
3
- name "susie-baynham.example.com"
4
- last_compile nil
5
- last_report nil
6
- updated_at nil
7
- root_pass "$5$pzp5IoYXH9WQT6Ks$fk1OzfJAK1"
8
- architecture_id 1
9
- operatingsystem_id 3
10
- environment_id 3
11
- ptable_id 91
12
- medium_id 13
13
- build true
14
- comment ""
15
- disk ""
16
- installed_at nil
17
- model_id nil
18
- hostgroup_id 31
19
- owner_id 4
20
- owner_type "User"
21
- enabled true
22
- puppet_ca_proxy_id nil
23
- managed true
24
- use_image nil
25
- image_file nil
26
- uuid nil
27
- compute_resource_id 7
28
- puppet_proxy_id 1
29
- certname nil
30
- image_id nil
31
- organization_id 2
32
- location_id 1
33
- type "Host::Managed"
34
- otp nil
35
- realm_id nil
36
- compute_profile_id nil
37
- provision_method "build"
38
- grub_pass "$6$aRZAzZm1TOa5WAGX$.Cwxy5zCrjVQqHUE/0Ic9oQ"
39
- global_status 0
40
- lookup_value_matcher "fqdn=susie-baynham.example.com"
41
- pxe_loader "PXELinux BIOS"
42
- initiated_at nil
43
- build_errors nil
3
+ name { "susie-baynham.example.com" }
4
+ last_compile { nil }
5
+ last_report { nil }
6
+ updated_at { nil }
7
+ root_pass { "$5$pzp5IoYXH9WQT6Ks$fk1OzfJAK1" }
8
+ architecture_id { 1 }
9
+ operatingsystem_id { 3 }
10
+ environment_id { 3 }
11
+ ptable_id { 91 }
12
+ medium_id { 13 }
13
+ build { true }
14
+ comment { "" }
15
+ disk { "" }
16
+ installed_at { nil }
17
+ model_id { nil }
18
+ hostgroup_id { 31 }
19
+ owner_id { 4 }
20
+ owner_type { "User" }
21
+ enabled { true }
22
+ puppet_ca_proxy_id { nil }
23
+ managed { true }
24
+ use_image { nil }
25
+ image_file { nil }
26
+ uuid { nil }
27
+ compute_resource_id { 7 }
28
+ puppet_proxy_id { 1 }
29
+ certname { nil }
30
+ image_id { nil }
31
+ organization_id { 2 }
32
+ location_id { 1 }
33
+ type { "Host::Managed" }
34
+ otp { nil }
35
+ realm_id { nil }
36
+ compute_profile_id { nil }
37
+ provision_method { "build" }
38
+ grub_pass { "$6$aRZAzZm1TOa5WAGX$.Cwxy5zCrjVQqHUE/0Ic9oQ" }
39
+ global_status { 0 }
40
+ lookup_value_matcher { "fqdn=susie-baynham.example.com" }
41
+ pxe_loader { "PXELinux BIOS" }
42
+ initiated_at { nil }
43
+ build_errors { nil }
44
44
 
45
45
  trait :with_interfaces do
46
46
  interfaces { build_list :nic_kubevirt, 1 }
@@ -1,31 +1,31 @@
1
1
  FactoryBot.define do
2
2
  factory :nic_kubevirt, class: 'Nic::Managed' do
3
- mac "a2:b4:a2:b2:a2:a8"
4
- ip "192.168.111.200"
5
- type "Nic::Managed"
6
- name "elton-kniola.example.com"
7
- host_id 1
8
- subnet_id 2
9
- domain_id 1
3
+ mac { "a2:b4:a2:b2:a2:a8" }
4
+ ip { "192.168.111.200" }
5
+ type { "Nic::Managed" }
6
+ name { "elton-kniola.example.com" }
7
+ host_id { 1 }
8
+ subnet_id { 2 }
9
+ domain_id { 1 }
10
10
  attrs {}
11
- created_at nil
12
- updated_at nil
13
- provider nil
14
- username nil
15
- password nil
16
- virtual false
17
- link true
18
- identifier ""
19
- tag ""
20
- attached_to ""
21
- managed true
22
- mode "balance-rr"
23
- attached_devices ""
24
- bond_options ""
25
- primary true
26
- provision true
11
+ created_at { nil }
12
+ updated_at { nil }
13
+ provider { nil }
14
+ username { nil }
15
+ password { nil }
16
+ virtual { false }
17
+ link { true }
18
+ identifier { "" }
19
+ tag { "" }
20
+ attached_to { "" }
21
+ managed { true }
22
+ mode { "balance-rr" }
23
+ attached_devices { "" }
24
+ bond_options { "" }
25
+ primary { true }
26
+ provision { true }
27
27
  compute_attributes { { "cni_provider" => "multus", "network" => "ovs-foreman" } }
28
- ip6 ""
29
- subnet6_id nil
28
+ ip6 { "" }
29
+ subnet6_id { nil }
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_kubevirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moti Asayag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -62,6 +62,7 @@ files:
62
62
  - LICENSE
63
63
  - README.md
64
64
  - Rakefile
65
+ - app/assets/javascripts/bundle.js
65
66
  - app/assets/javascripts/foreman_kubevirt/kubevirt.js
66
67
  - app/assets/javascripts/foreman_kubevirt/nic_info.js
67
68
  - app/controllers/foreman_kubevirt/concerns/api/compute_resources_controller_extensions.rb
@@ -113,15 +114,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
114
  - !ruby/object:Gem::Version
114
115
  version: '0'
115
116
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.6.14
117
+ rubygems_version: 3.0.3
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Provision and manage Kubevirt Virtual Machines from Foreman
121
121
  test_files:
122
- - test/factories/nic_factories.rb
123
- - test/factories/compute_resource_factories.rb
122
+ - test/unit/foreman_kubevirt_test.rb
124
123
  - test/factories/host_factories.rb
125
- - test/test_plugin_helper.rb
124
+ - test/factories/compute_resource_factories.rb
125
+ - test/factories/nic_factories.rb
126
126
  - test/models/compute_resources/kubevirt_test.rb
127
- - test/unit/foreman_kubevirt_test.rb
127
+ - test/test_plugin_helper.rb