@@ -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,47 @@ 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
+ log .Tracef ("NewLibvirtProvisioner properties %v" , properties )
108
+
109
+ log .Tracef ("NewLibvirtProvisioner secure_comms %s" , secure_comms )
110
+
111
+ secure_comms_kbs_addr := ""
112
+ if properties ["SECURE_COMMS_KBS_ADDR" ] != "" {
113
+ secure_comms_kbs_addr = properties ["SECURE_COMMS_KBS_ADDR" ]
114
+ }
115
+
116
+ secure_comms_no_trustee := "false"
117
+ if properties ["SECURE_COMMS_NO_TRUSTEE" ] != "" {
118
+ secure_comms_no_trustee = properties ["SECURE_COMMS_NO_TRUSTEE" ]
119
+ }
120
+
121
+ initdata := ""
122
+ if properties ["INITDATA" ] != "" {
123
+ initdata = properties ["INITDATA" ]
124
+ }
125
+
98
126
// TODO: Check network and storage are not nil?
99
127
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 ,
128
+ conn : conn ,
129
+ containerRuntime : properties ["container_runtime" ],
130
+ network : network ,
131
+ ssh_key_file : ssh_key_file ,
132
+ storage : storage ,
133
+ uri : uri ,
134
+ wd : wd ,
135
+ volumeName : vol_name ,
136
+ clusterName : clusterName ,
137
+ tunnelType : tunnelType ,
138
+ vxlanPort : vxlanPort ,
139
+ secure_comms : secure_comms ,
140
+ secure_comms_kbs_addr : secure_comms_kbs_addr ,
141
+ secure_comms_no_trustee : secure_comms_no_trustee ,
142
+ initdata : initdata ,
111
143
}, nil
112
144
}
113
145
@@ -212,14 +244,18 @@ func (l *LibvirtProvisioner) DeleteVPC(ctx context.Context, cfg *envconf.Config)
212
244
213
245
func (l * LibvirtProvisioner ) GetProperties (ctx context.Context , cfg * envconf.Config ) map [string ]string {
214
246
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 ,
247
+ "CONTAINER_RUNTIME" : l .containerRuntime ,
248
+ "network" : l .network ,
249
+ "podvm_volume" : l .volumeName ,
250
+ "ssh_key_file" : l .ssh_key_file ,
251
+ "storage" : l .storage ,
252
+ "uri" : l .uri ,
253
+ "tunnel_type" : l .tunnelType ,
254
+ "vxlan_port" : l .vxlanPort ,
255
+ "SECURE_COMMS" : l .secure_comms ,
256
+ "SECURE_COMMS_KBS_ADDR" : l .secure_comms_kbs_addr ,
257
+ "SECURE_COMMS_NO_TRUSTEE" : l .secure_comms_no_trustee ,
258
+ "INITDATA" : l .initdata ,
223
259
}
224
260
}
225
261
@@ -326,14 +362,17 @@ func (lio *LibvirtInstallOverlay) Edit(ctx context.Context, cfg *envconf.Config,
326
362
327
363
// Mapping the internal properties to ConfigMapGenerator properties and their default values.
328
364
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" },
365
+ "network" : {"default" , "LIBVIRT_NET" },
366
+ "storage" : {"default" , "LIBVIRT_POOL" },
367
+ "pause_image" : {"" , "PAUSE_IMAGE" },
368
+ "podvm_volume" : {"" , "LIBVIRT_VOL_NAME" },
369
+ "uri" : {
"qemu+ssh://[email protected] /system?no_verify=1" ,
"LIBVIRT_URI" },
370
+ "tunnel_type" : {"" , "TUNNEL_TYPE" },
371
+ "vxlan_port" : {"" , "VXLAN_PORT" },
372
+ "INITDATA" : {"" , "INITDATA" },
373
+ "SECURE_COMMS" : {"" , "SECURE_COMMS" },
374
+ "SECURE_COMMS_NO_TRUSTEE" : {"" , "SECURE_COMMS_NO_TRUSTEE" },
375
+ "SECURE_COMMS_KBS_ADDR" : {"" , "SECURE_COMMS_KBS_ADDR" },
337
376
}
338
377
339
378
for k , v := range mapProps {
0 commit comments