-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SecureComms: E2e test SecureComms without KBS
Add support for e2e testing SecureComms without KBS Signed-off-by: David Hadas <[email protected]>
- Loading branch information
1 parent
711a542
commit 524869d
Showing
6 changed files
with
104 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,14 +23,18 @@ const AlternateVolumeName = "another-podvm-base.qcow2" | |
|
||
// LibvirtProvisioner implements the CloudProvisioner interface for Libvirt. | ||
type LibvirtProvisioner struct { | ||
conn *libvirt.Connect // Libvirt connection | ||
network string // Network name | ||
ssh_key_file string // SSH key file used to connect to Libvirt | ||
storage string // Storage pool name | ||
uri string // Libvirt URI | ||
wd string // libvirt's directory path on this repository | ||
volumeName string // Podvm volume name | ||
clusterName string // Cluster name | ||
conn *libvirt.Connect // Libvirt connection | ||
network string // Network name | ||
ssh_key_file string // SSH key file used to connect to Libvirt | ||
storage string // Storage pool name | ||
uri string // Libvirt URI | ||
wd string // libvirt's directory path on this repository | ||
volumeName string // Podvm volume name | ||
clusterName string // Cluster name | ||
secure_comms string // Activate CAA SECURE_COMMS | ||
secure_comms_no_trustee string // Deactivate Trustee mode in SECURE_COMMS | ||
secure_comms_kbs_addr string // KBS URL | ||
initdata string // InitData | ||
} | ||
|
||
// LibvirtInstallOverlay implements the InstallOverlay interface | ||
|
@@ -82,16 +86,40 @@ func NewLibvirtProvisioner(properties map[string]string) (pv.CloudProvisioner, e | |
clusterName = properties["cluster_name"] | ||
} | ||
|
||
secure_comms := "false" | ||
if properties["SECURE_COMMS"] != "" { | ||
secure_comms = properties["SECURE_COMMS"] | ||
} | ||
|
||
secure_comms_kbs_addr := "" | ||
if properties["SECURE_COMMS_KBS_ADDR"] != "" { | ||
secure_comms_kbs_addr = properties["SECURE_COMMS_KBS_ADDR"] | ||
} | ||
|
||
secure_comms_no_trustee := "false" | ||
if properties["SECURE_COMMS_NO_TRUSTEE"] != "" { | ||
secure_comms_no_trustee = properties["SECURE_COMMS_NO_TRUSTEE"] | ||
} | ||
|
||
initdata := "" | ||
if properties["INITDATA"] != "" { | ||
initdata = properties["INITDATA"] | ||
} | ||
|
||
// TODO: Check network and storage are not nil? | ||
return &LibvirtProvisioner{ | ||
conn: conn, | ||
network: network, | ||
ssh_key_file: ssh_key_file, | ||
storage: storage, | ||
uri: uri, | ||
wd: wd, | ||
volumeName: vol_name, | ||
clusterName: clusterName, | ||
conn: conn, | ||
network: network, | ||
ssh_key_file: ssh_key_file, | ||
storage: storage, | ||
uri: uri, | ||
wd: wd, | ||
volumeName: vol_name, | ||
clusterName: clusterName, | ||
secure_comms: secure_comms, | ||
secure_comms_kbs_addr: secure_comms_kbs_addr, | ||
secure_comms_no_trustee: secure_comms_no_trustee, | ||
initdata: initdata, | ||
}, nil | ||
} | ||
|
||
|
@@ -196,11 +224,15 @@ func (l *LibvirtProvisioner) DeleteVPC(ctx context.Context, cfg *envconf.Config) | |
|
||
func (l *LibvirtProvisioner) GetProperties(ctx context.Context, cfg *envconf.Config) map[string]string { | ||
return map[string]string{ | ||
"network": l.network, | ||
"podvm_volume": l.volumeName, | ||
"ssh_key_file": l.ssh_key_file, | ||
"storage": l.storage, | ||
"uri": l.uri, | ||
"network": l.network, | ||
"podvm_volume": l.volumeName, | ||
"ssh_key_file": l.ssh_key_file, | ||
"storage": l.storage, | ||
"uri": l.uri, | ||
"SECURE_COMMS": l.secure_comms, | ||
"SECURE_COMMS_KBS_ADDR": l.secure_comms_kbs_addr, | ||
"SECURE_COMMS_NO_TRUSTEE": l.secure_comms_no_trustee, | ||
"INITDATA": l.initdata, | ||
} | ||
} | ||
|
||
|
@@ -307,13 +339,16 @@ func (lio *LibvirtInstallOverlay) Edit(ctx context.Context, cfg *envconf.Config, | |
|
||
// Mapping the internal properties to ConfigMapGenerator properties and their default values. | ||
mapProps := map[string][2]string{ | ||
"network": {"default", "LIBVIRT_NET"}, | ||
"storage": {"default", "LIBVIRT_POOL"}, | ||
"pause_image": {"", "PAUSE_IMAGE"}, | ||
"podvm_volume": {"", "LIBVIRT_VOL_NAME"}, | ||
"uri": {"qemu+ssh://[email protected]/system?no_verify=1", "LIBVIRT_URI"}, | ||
"vxlan_port": {"", "VXLAN_PORT"}, | ||
"INITDATA": {"", "INITDATA"}, | ||
"network": {"default", "LIBVIRT_NET"}, | ||
"storage": {"default", "LIBVIRT_POOL"}, | ||
"pause_image": {"", "PAUSE_IMAGE"}, | ||
"podvm_volume": {"", "LIBVIRT_VOL_NAME"}, | ||
"uri": {"qemu+ssh://[email protected]/system?no_verify=1", "LIBVIRT_URI"}, | ||
"vxlan_port": {"", "VXLAN_PORT"}, | ||
"INITDATA": {"", "INITDATA"}, | ||
"SECURE_COMMS": {"", "SECURE_COMMS"}, | ||
"SECURE_COMMS_NO_TRUSTEE": {"", "SECURE_COMMS_NO_TRUSTEE"}, | ||
"SECURE_COMMS_KBS_ADDR": {"", "SECURE_COMMS_KBS_ADDR"}, | ||
} | ||
|
||
for k, v := range mapProps { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters