@@ -23,17 +23,21 @@ const AlternateVolumeName = "another-podvm-base.qcow2"
23
23
24
24
// LibvirtProvisioner implements the CloudProvisioner interface for Libvirt.
25
25
type LibvirtProvisioner struct {
26
- conn * libvirt.Connect // Libvirt connection
27
- containerRuntime string // Name of the container runtime
28
- network string // Network name
29
- ssh_key_file string // SSH key file used to connect to Libvirt
30
- storage string // Storage pool name
31
- uri string // Libvirt URI
32
- wd string // libvirt's directory path on this repository
33
- volumeName string // Podvm volume name
34
- clusterName string // Cluster name
35
- tunnelType string // Tunnel Type
36
- vxlanPort string // VXLAN port number
26
+ conn * libvirt.Connect // Libvirt connection
27
+ containerRuntime string // Name of the container runtime
28
+ network string // Network name
29
+ ssh_key_file string // SSH key file used to connect to Libvirt
30
+ storage string // Storage pool name
31
+ uri string // Libvirt URI
32
+ wd string // libvirt's directory path on this repository
33
+ volumeName string // Podvm volume name
34
+ clusterName string // Cluster name
35
+ tunnelType string // Tunnel Type
36
+ vxlanPort string // VXLAN port number
37
+ secure_comms string // Activate CAA SECURE_COMMS
38
+ secure_comms_no_trustee string // Deactivate Trustee mode in SECURE_COMMS
39
+ secure_comms_kbs_addr string // KBS URL
40
+ initdata string // InitData
37
41
}
38
42
39
43
// LibvirtInstallOverlay implements the InstallOverlay interface
@@ -95,19 +99,43 @@ func NewLibvirtProvisioner(properties map[string]string) (pv.CloudProvisioner, e
95
99
vxlanPort = properties ["vxlan_port" ]
96
100
}
97
101
102
+ secure_comms := "false"
103
+ if properties ["SECURE_COMMS" ] != "" {
104
+ secure_comms = properties ["SECURE_COMMS" ]
105
+ }
106
+
107
+ secure_comms_kbs_addr := ""
108
+ if properties ["SECURE_COMMS_KBS_ADDR" ] != "" {
109
+ secure_comms_kbs_addr = properties ["SECURE_COMMS_KBS_ADDR" ]
110
+ }
111
+
112
+ secure_comms_no_trustee := "false"
113
+ if properties ["SECURE_COMMS_NO_TRUSTEE" ] != "" {
114
+ secure_comms_no_trustee = properties ["SECURE_COMMS_NO_TRUSTEE" ]
115
+ }
116
+
117
+ initdata := ""
118
+ if properties ["INITDATA" ] != "" {
119
+ initdata = properties ["INITDATA" ]
120
+ }
121
+
98
122
// TODO: Check network and storage are not nil?
99
123
return & LibvirtProvisioner {
100
- conn : conn ,
101
- containerRuntime : properties ["container_runtime" ],
102
- network : network ,
103
- ssh_key_file : ssh_key_file ,
104
- storage : storage ,
105
- uri : uri ,
106
- wd : wd ,
107
- volumeName : vol_name ,
108
- clusterName : clusterName ,
109
- tunnelType : tunnelType ,
110
- vxlanPort : vxlanPort ,
124
+ conn : conn ,
125
+ containerRuntime : properties ["container_runtime" ],
126
+ network : network ,
127
+ ssh_key_file : ssh_key_file ,
128
+ storage : storage ,
129
+ uri : uri ,
130
+ wd : wd ,
131
+ volumeName : vol_name ,
132
+ clusterName : clusterName ,
133
+ tunnelType : tunnelType ,
134
+ vxlanPort : vxlanPort ,
135
+ secure_comms : secure_comms ,
136
+ secure_comms_kbs_addr : secure_comms_kbs_addr ,
137
+ secure_comms_no_trustee : secure_comms_no_trustee ,
138
+ initdata : initdata ,
111
139
}, nil
112
140
}
113
141
@@ -212,14 +240,18 @@ func (l *LibvirtProvisioner) DeleteVPC(ctx context.Context, cfg *envconf.Config)
212
240
213
241
func (l * LibvirtProvisioner ) GetProperties (ctx context.Context , cfg * envconf.Config ) map [string ]string {
214
242
return map [string ]string {
215
- "CONTAINER_RUNTIME" : l .containerRuntime ,
216
- "network" : l .network ,
217
- "podvm_volume" : l .volumeName ,
218
- "ssh_key_file" : l .ssh_key_file ,
219
- "storage" : l .storage ,
220
- "uri" : l .uri ,
221
- "tunnel_type" : l .tunnelType ,
222
- "vxlan_port" : l .vxlanPort ,
243
+ "CONTAINER_RUNTIME" : l .containerRuntime ,
244
+ "network" : l .network ,
245
+ "podvm_volume" : l .volumeName ,
246
+ "ssh_key_file" : l .ssh_key_file ,
247
+ "storage" : l .storage ,
248
+ "uri" : l .uri ,
249
+ "tunnel_type" : l .tunnelType ,
250
+ "vxlan_port" : l .vxlanPort ,
251
+ "SECURE_COMMS" : l .secure_comms ,
252
+ "SECURE_COMMS_KBS_ADDR" : l .secure_comms_kbs_addr ,
253
+ "SECURE_COMMS_NO_TRUSTEE" : l .secure_comms_no_trustee ,
254
+ "INITDATA" : l .initdata ,
223
255
}
224
256
}
225
257
@@ -326,14 +358,17 @@ func (lio *LibvirtInstallOverlay) Edit(ctx context.Context, cfg *envconf.Config,
326
358
327
359
// Mapping the internal properties to ConfigMapGenerator properties and their default values.
328
360
mapProps := map [string ][2 ]string {
329
- "network" : {"default" , "LIBVIRT_NET" },
330
- "storage" : {"default" , "LIBVIRT_POOL" },
331
- "pause_image" : {"" , "PAUSE_IMAGE" },
332
- "podvm_volume" : {"" , "LIBVIRT_VOL_NAME" },
333
- "uri" : {
"qemu+ssh://[email protected] /system?no_verify=1" ,
"LIBVIRT_URI" },
334
- "tunnel_type" : {"" , "TUNNEL_TYPE" },
335
- "vxlan_port" : {"" , "VXLAN_PORT" },
336
- "INITDATA" : {"" , "INITDATA" },
361
+ "network" : {"default" , "LIBVIRT_NET" },
362
+ "storage" : {"default" , "LIBVIRT_POOL" },
363
+ "pause_image" : {"" , "PAUSE_IMAGE" },
364
+ "podvm_volume" : {"" , "LIBVIRT_VOL_NAME" },
365
+ "uri" : {
"qemu+ssh://[email protected] /system?no_verify=1" ,
"LIBVIRT_URI" },
366
+ "tunnel_type" : {"" , "TUNNEL_TYPE" },
367
+ "vxlan_port" : {"" , "VXLAN_PORT" },
368
+ "INITDATA" : {"" , "INITDATA" },
369
+ "SECURE_COMMS" : {"" , "SECURE_COMMS" },
370
+ "SECURE_COMMS_NO_TRUSTEE" : {"" , "SECURE_COMMS_NO_TRUSTEE" },
371
+ "SECURE_COMMS_KBS_ADDR" : {"" , "SECURE_COMMS_KBS_ADDR" },
337
372
}
338
373
339
374
for k , v := range mapProps {
0 commit comments