foreman_kubevirt 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/foreman_kubevirt/concerns/api/compute_resources_controller_extensions.rb +9 -9
- data/app/models/foreman_kubevirt/kubevirt.rb +13 -16
- data/app/validators/volume_validator.rb +2 -2
- data/lib/foreman_kubevirt/version.rb +1 -1
- data/locale/action_names.rb +5 -0
- data/locale/ca/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/ca/foreman_kubevirt.po +170 -0
- data/locale/cs_CZ/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/cs_CZ/foreman_kubevirt.po +170 -0
- data/locale/de/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/de/foreman_kubevirt.po +170 -0
- data/locale/en/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/en/foreman_kubevirt.edit.po +219 -0
- data/locale/en/foreman_kubevirt.po +162 -11
- data/locale/en/foreman_kubevirt.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/en_GB/foreman_kubevirt.po +170 -0
- data/locale/es/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/es/foreman_kubevirt.po +170 -0
- data/locale/foreman_kubevirt.pot +232 -8
- data/locale/fr/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/fr/foreman_kubevirt.po +170 -0
- data/locale/gemspec.rb +1 -1
- data/locale/gl/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/gl/foreman_kubevirt.po +170 -0
- data/locale/it/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/it/foreman_kubevirt.po +170 -0
- data/locale/ja/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/ja/foreman_kubevirt.po +170 -0
- data/locale/ko/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/ko/foreman_kubevirt.po +170 -0
- data/locale/nl_NL/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/nl_NL/foreman_kubevirt.po +177 -0
- data/locale/pl/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/pl/foreman_kubevirt.po +176 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/pt_BR/foreman_kubevirt.po +178 -0
- data/locale/ru/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/ru/foreman_kubevirt.po +180 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/sv_SE/foreman_kubevirt.po +176 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/zh_CN/foreman_kubevirt.po +177 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_kubevirt.mo +0 -0
- data/locale/zh_TW/foreman_kubevirt.po +175 -0
- data/test/models/compute_resources/kubevirt_test.rb +1 -1
- data/test/unit/foreman_kubevirt_test.rb +0 -2
- metadata +43 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b284e744d2f757d5493ff422214f54fd3247f50fc57cdcf3a64fe56f09c8cebe
|
4
|
+
data.tar.gz: c0468a5c9499fe9930d66efdba3519ea251963fdd07fa03b6cbd0ad2cebe28d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4882fb3ac0e11da7bb342249518066df95202b87f906a487a82be829544d1a46a1512fa1b71ec2367ce55f8fbaacad40e42fadb2a6bd641581afcc3e88f6750
|
7
|
+
data.tar.gz: c1f5a09d792cebef6f12390f6aefae6c2b47cd7f1ed11bf39d4727208eec825ba7677cb77fe352a9a7ccdd1f1153b1a14463affd05ac0db60e712af60c5362c0
|
data/app/controllers/foreman_kubevirt/concerns/api/compute_resources_controller_extensions.rb
CHANGED
@@ -2,17 +2,17 @@ module ForemanKubevirt
|
|
2
2
|
module Concerns
|
3
3
|
module Api
|
4
4
|
module ComputeResourcesControllerExtensions
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
5
|
+
extend ::Apipie::DSL::Concern
|
6
|
+
update_api(:create, :update) do
|
7
|
+
param :compute_resource, Hash do
|
8
|
+
param :token, String, :desc => N_("Token for KubeVirt only")
|
9
|
+
param :hostname, String, :desc => N_("Host name for KubeVirt only")
|
10
|
+
param :namespace, String, :desc => N_("Namespace for KubeVirt only")
|
11
|
+
param :ca_crt, String, :desc => N_("CA crt for KubeVirt only")
|
12
|
+
param :api_port, String, :desc => N_("API port for KubeVirt only")
|
14
13
|
end
|
15
14
|
end
|
15
|
+
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -66,19 +66,17 @@ module ForemanKubevirt
|
|
66
66
|
return false if errors.any?
|
67
67
|
client&.valid? && client&.virt_supported?
|
68
68
|
rescue StandardError => e
|
69
|
-
|
69
|
+
if e.message =~ /401/
|
70
70
|
errors[:base] << _('The compute resource could not be authenticated')
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
else
|
72
|
+
errors[:base] << e.message
|
73
|
+
end
|
74
74
|
end
|
75
75
|
|
76
76
|
def connection_properties_valid?
|
77
77
|
errors[:hostname].empty? && errors[:token].empty? && errors[:namespace].empty? && errors[:api_port].empty?
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
|
-
|
82
80
|
def networks
|
83
81
|
client.networkattachmentdefs.all
|
84
82
|
rescue StandardError => e
|
@@ -106,7 +104,6 @@ module ForemanKubevirt
|
|
106
104
|
storage_classes.map { |sc| OpenStruct.new(id: sc.name, description: "#{sc.name} (#{sc.provisioner})") }
|
107
105
|
end
|
108
106
|
|
109
|
-
|
110
107
|
def new_volume(attrs = {})
|
111
108
|
return unless new_volume_errors.empty?
|
112
109
|
capacity = attrs.delete(:capacity)
|
@@ -177,7 +174,7 @@ module ForemanKubevirt
|
|
177
174
|
:networks => networks,
|
178
175
|
:interfaces => interfaces)
|
179
176
|
client.servers.get(options[:name])
|
180
|
-
rescue Exception
|
177
|
+
rescue Exception => e
|
181
178
|
delete_pvcs(volumes) if volumes
|
182
179
|
raise e
|
183
180
|
end
|
@@ -307,13 +304,13 @@ module ForemanKubevirt
|
|
307
304
|
vnc_details = client.vminstances.get_vnc_console_details(vm.name, namespace)
|
308
305
|
token = Base64.encode64(vnc_details[:token]).delete!("\n").delete("==")
|
309
306
|
{
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
307
|
+
:host => vnc_details[:host],
|
308
|
+
:port => vnc_details[:port],
|
309
|
+
:path => vnc_details[:path],
|
310
|
+
:token_protocol => token_protocol(token),
|
311
|
+
:plain_protocol => plain_kubevirt_protocol,
|
312
|
+
:type => 'vnc',
|
313
|
+
:encrypt => true
|
317
314
|
}
|
318
315
|
end
|
319
316
|
|
@@ -386,7 +383,7 @@ module ForemanKubevirt
|
|
386
383
|
end
|
387
384
|
|
388
385
|
def validate_only_single_bootable_volume(volumes_attributes)
|
389
|
-
raise ::Foreman::Exception.new N_('Only one volume can be bootable') if volumes_attributes.
|
386
|
+
raise ::Foreman::Exception.new N_('Only one volume can be bootable') if volumes_attributes.count { |_, v| v[:bootable] == "true" } > 1
|
390
387
|
end
|
391
388
|
|
392
389
|
def create_new_pvc(pvc_name, capacity, storage_class)
|
@@ -2,9 +2,9 @@ class VolumeValidator < ActiveModel::EachValidator
|
|
2
2
|
def validate_each(record, attribute, value)
|
3
3
|
if value[:volumes_attributes].present?
|
4
4
|
value[:volumes_attributes].each do |_, attrs|
|
5
|
-
if attrs.key?("capacity")
|
5
|
+
if attrs.key?("capacity") && attrs.key?("storage_class")
|
6
6
|
if attrs["capacity"].to_s.empty? || /\A\d+G?\Z/.match(attrs["capacity"].to_s).nil?
|
7
|
-
record.errors.add(attribute, _("Volume size #{attrs[
|
7
|
+
record.errors.add(attribute, _("Volume size #{attrs['capacity']} is not valid"))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
Binary file
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# Catalan translations for foreman_kubevirt package.
|
2
|
+
# Copyright (C) 2020 THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the foreman_kubevirt package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
|
5
|
+
#
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: foreman_kubevirt 1.0.0\n"
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
10
|
+
"PO-Revision-Date: 2020-05-26 13:16+0530\n"
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12
|
+
"Language-Team: Catalan\n"
|
13
|
+
"Language: ca\n"
|
14
|
+
"MIME-Version: 1.0\n"
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
17
|
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
18
|
+
"\n"
|
19
|
+
|
20
|
+
msgid "%{cpu_cores} Cores and %{memory} memory"
|
21
|
+
msgstr ""
|
22
|
+
|
23
|
+
msgid "API Port"
|
24
|
+
msgstr ""
|
25
|
+
|
26
|
+
msgid "API port for KubeVirt only"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
msgid "Actions"
|
30
|
+
msgstr ""
|
31
|
+
|
32
|
+
msgid "Bootable"
|
33
|
+
msgstr ""
|
34
|
+
|
35
|
+
msgid "CA crt for KubeVirt only"
|
36
|
+
msgstr ""
|
37
|
+
|
38
|
+
msgid "CNI Provider"
|
39
|
+
msgstr ""
|
40
|
+
|
41
|
+
msgid "CPUs"
|
42
|
+
msgstr ""
|
43
|
+
|
44
|
+
msgid "Disk"
|
45
|
+
msgstr ""
|
46
|
+
|
47
|
+
msgid "Does this image support user data input (e.g. via cloud-init)?"
|
48
|
+
msgstr ""
|
49
|
+
|
50
|
+
msgid "Host name for KubeVirt only"
|
51
|
+
msgstr ""
|
52
|
+
|
53
|
+
msgid "Hostname"
|
54
|
+
msgstr ""
|
55
|
+
|
56
|
+
msgid "Image"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "It is not possible to set a bootable volume and image based provisioning."
|
60
|
+
msgstr ""
|
61
|
+
|
62
|
+
msgid "Memory"
|
63
|
+
msgstr ""
|
64
|
+
|
65
|
+
msgid "NIC"
|
66
|
+
msgstr ""
|
67
|
+
|
68
|
+
msgid "Name"
|
69
|
+
msgstr ""
|
70
|
+
|
71
|
+
msgid "Namespace"
|
72
|
+
msgstr ""
|
73
|
+
|
74
|
+
msgid "Namespace for KubeVirt only"
|
75
|
+
msgstr ""
|
76
|
+
|
77
|
+
msgid "Network"
|
78
|
+
msgstr ""
|
79
|
+
|
80
|
+
msgid "Only one volume can be bootable"
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
msgid "Optionally provide a CA, or a correctly ordered CA chain or a path to a file. If left blank - insecure."
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
msgid "Password to authenticate with - used for SSH finish step."
|
87
|
+
msgstr ""
|
88
|
+
|
89
|
+
msgid "Please select an image"
|
90
|
+
msgstr ""
|
91
|
+
|
92
|
+
msgid "Power"
|
93
|
+
msgstr ""
|
94
|
+
|
95
|
+
msgid "Power ON this machine"
|
96
|
+
msgstr ""
|
97
|
+
|
98
|
+
msgid "Properties"
|
99
|
+
msgstr ""
|
100
|
+
|
101
|
+
msgid "Provision and manage Kubevirt Virtual Machines from Foreman."
|
102
|
+
msgstr ""
|
103
|
+
|
104
|
+
msgid "Running on"
|
105
|
+
msgstr ""
|
106
|
+
|
107
|
+
msgid "Size (GB)"
|
108
|
+
msgstr ""
|
109
|
+
|
110
|
+
msgid "Start"
|
111
|
+
msgstr ""
|
112
|
+
|
113
|
+
msgid "Storage Class"
|
114
|
+
msgstr ""
|
115
|
+
|
116
|
+
msgid "The compute resource could not be authenticated"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "The name of the image in the registry."
|
120
|
+
msgstr ""
|
121
|
+
|
122
|
+
msgid ""
|
123
|
+
"The remote system presented a public key signed by an unidentified certificate authority.\n"
|
124
|
+
" If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' button and submit"
|
125
|
+
msgstr ""
|
126
|
+
|
127
|
+
msgid "The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc"
|
128
|
+
msgstr ""
|
129
|
+
|
130
|
+
msgid "Token"
|
131
|
+
msgstr ""
|
132
|
+
|
133
|
+
msgid "Token for KubeVirt only"
|
134
|
+
msgstr ""
|
135
|
+
|
136
|
+
msgid "Type"
|
137
|
+
msgstr ""
|
138
|
+
|
139
|
+
msgid "UUID"
|
140
|
+
msgstr ""
|
141
|
+
|
142
|
+
msgid "VCPU(s)"
|
143
|
+
msgstr ""
|
144
|
+
|
145
|
+
msgid "VM should be created based on Persistent Volume Claim or Image"
|
146
|
+
msgstr ""
|
147
|
+
|
148
|
+
msgid "VM should be created based on an image"
|
149
|
+
msgstr ""
|
150
|
+
|
151
|
+
msgid "X509 Certification Authorities"
|
152
|
+
msgstr ""
|
153
|
+
|
154
|
+
msgid "cni_provider or network are missing"
|
155
|
+
msgstr ""
|
156
|
+
|
157
|
+
msgid "e.g. eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..."
|
158
|
+
msgstr ""
|
159
|
+
|
160
|
+
msgid "genie"
|
161
|
+
msgstr ""
|
162
|
+
|
163
|
+
msgid "multus"
|
164
|
+
msgstr ""
|
165
|
+
|
166
|
+
msgid "no Storage Classes available on provider"
|
167
|
+
msgstr ""
|
168
|
+
|
169
|
+
msgid "pod"
|
170
|
+
msgstr ""
|
Binary file
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# Czech translations for foreman_kubevirt package.
|
2
|
+
# Copyright (C) 2020 THE PACKAGE'S COPYRIGHT HOLDER
|
3
|
+
# This file is distributed under the same license as the foreman_kubevirt package.
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2020.
|
5
|
+
#
|
6
|
+
msgid ""
|
7
|
+
msgstr ""
|
8
|
+
"Project-Id-Version: foreman_kubevirt 1.0.0\n"
|
9
|
+
"Report-Msgid-Bugs-To: \n"
|
10
|
+
"PO-Revision-Date: 2020-05-26 13:16+0530\n"
|
11
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
12
|
+
"Language-Team: Czech\n"
|
13
|
+
"Language: cs_CZ\n"
|
14
|
+
"MIME-Version: 1.0\n"
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
17
|
+
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
18
|
+
"\n"
|
19
|
+
|
20
|
+
msgid "%{cpu_cores} Cores and %{memory} memory"
|
21
|
+
msgstr ""
|
22
|
+
|
23
|
+
msgid "API Port"
|
24
|
+
msgstr ""
|
25
|
+
|
26
|
+
msgid "API port for KubeVirt only"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
msgid "Actions"
|
30
|
+
msgstr ""
|
31
|
+
|
32
|
+
msgid "Bootable"
|
33
|
+
msgstr ""
|
34
|
+
|
35
|
+
msgid "CA crt for KubeVirt only"
|
36
|
+
msgstr ""
|
37
|
+
|
38
|
+
msgid "CNI Provider"
|
39
|
+
msgstr ""
|
40
|
+
|
41
|
+
msgid "CPUs"
|
42
|
+
msgstr ""
|
43
|
+
|
44
|
+
msgid "Disk"
|
45
|
+
msgstr ""
|
46
|
+
|
47
|
+
msgid "Does this image support user data input (e.g. via cloud-init)?"
|
48
|
+
msgstr ""
|
49
|
+
|
50
|
+
msgid "Host name for KubeVirt only"
|
51
|
+
msgstr ""
|
52
|
+
|
53
|
+
msgid "Hostname"
|
54
|
+
msgstr ""
|
55
|
+
|
56
|
+
msgid "Image"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
msgid "It is not possible to set a bootable volume and image based provisioning."
|
60
|
+
msgstr ""
|
61
|
+
|
62
|
+
msgid "Memory"
|
63
|
+
msgstr ""
|
64
|
+
|
65
|
+
msgid "NIC"
|
66
|
+
msgstr ""
|
67
|
+
|
68
|
+
msgid "Name"
|
69
|
+
msgstr ""
|
70
|
+
|
71
|
+
msgid "Namespace"
|
72
|
+
msgstr ""
|
73
|
+
|
74
|
+
msgid "Namespace for KubeVirt only"
|
75
|
+
msgstr ""
|
76
|
+
|
77
|
+
msgid "Network"
|
78
|
+
msgstr ""
|
79
|
+
|
80
|
+
msgid "Only one volume can be bootable"
|
81
|
+
msgstr ""
|
82
|
+
|
83
|
+
msgid "Optionally provide a CA, or a correctly ordered CA chain or a path to a file. If left blank - insecure."
|
84
|
+
msgstr ""
|
85
|
+
|
86
|
+
msgid "Password to authenticate with - used for SSH finish step."
|
87
|
+
msgstr ""
|
88
|
+
|
89
|
+
msgid "Please select an image"
|
90
|
+
msgstr ""
|
91
|
+
|
92
|
+
msgid "Power"
|
93
|
+
msgstr ""
|
94
|
+
|
95
|
+
msgid "Power ON this machine"
|
96
|
+
msgstr ""
|
97
|
+
|
98
|
+
msgid "Properties"
|
99
|
+
msgstr ""
|
100
|
+
|
101
|
+
msgid "Provision and manage Kubevirt Virtual Machines from Foreman."
|
102
|
+
msgstr ""
|
103
|
+
|
104
|
+
msgid "Running on"
|
105
|
+
msgstr ""
|
106
|
+
|
107
|
+
msgid "Size (GB)"
|
108
|
+
msgstr ""
|
109
|
+
|
110
|
+
msgid "Start"
|
111
|
+
msgstr ""
|
112
|
+
|
113
|
+
msgid "Storage Class"
|
114
|
+
msgstr ""
|
115
|
+
|
116
|
+
msgid "The compute resource could not be authenticated"
|
117
|
+
msgstr ""
|
118
|
+
|
119
|
+
msgid "The name of the image in the registry."
|
120
|
+
msgstr ""
|
121
|
+
|
122
|
+
msgid ""
|
123
|
+
"The remote system presented a public key signed by an unidentified certificate authority.\n"
|
124
|
+
" If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' button and submit"
|
125
|
+
msgstr ""
|
126
|
+
|
127
|
+
msgid "The user that is used to ssh into the instance, normally cloud-user, ec2-user, ubuntu, root etc"
|
128
|
+
msgstr ""
|
129
|
+
|
130
|
+
msgid "Token"
|
131
|
+
msgstr ""
|
132
|
+
|
133
|
+
msgid "Token for KubeVirt only"
|
134
|
+
msgstr ""
|
135
|
+
|
136
|
+
msgid "Type"
|
137
|
+
msgstr ""
|
138
|
+
|
139
|
+
msgid "UUID"
|
140
|
+
msgstr ""
|
141
|
+
|
142
|
+
msgid "VCPU(s)"
|
143
|
+
msgstr ""
|
144
|
+
|
145
|
+
msgid "VM should be created based on Persistent Volume Claim or Image"
|
146
|
+
msgstr ""
|
147
|
+
|
148
|
+
msgid "VM should be created based on an image"
|
149
|
+
msgstr ""
|
150
|
+
|
151
|
+
msgid "X509 Certification Authorities"
|
152
|
+
msgstr ""
|
153
|
+
|
154
|
+
msgid "cni_provider or network are missing"
|
155
|
+
msgstr ""
|
156
|
+
|
157
|
+
msgid "e.g. eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9..."
|
158
|
+
msgstr ""
|
159
|
+
|
160
|
+
msgid "genie"
|
161
|
+
msgstr ""
|
162
|
+
|
163
|
+
msgid "multus"
|
164
|
+
msgstr ""
|
165
|
+
|
166
|
+
msgid "no Storage Classes available on provider"
|
167
|
+
msgstr ""
|
168
|
+
|
169
|
+
msgid "pod"
|
170
|
+
msgstr ""
|