Merge pull request #9874 from GabyCT/topic/fixvarnerdctl

tests: nerdctl: Fix variables names and remove network
This commit is contained in:
GabyCT 2024-06-19 13:43:25 -06:00 committed by GitHub
commit 02075f73e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,12 +86,12 @@ function run() {
# that an interface called eth0 exists on the host.
local ipvlan_net_name="ipvlan10"
info "Creating ipvlan network with eth0 interface on host as parent"
sudo nerdctl network create ${ipvlan_net_name=} --driver ipvlan --subnet=10.5.74.0/24 -o parent=${parent_interface}
sudo nerdctl network create ${ipvlan_net_name} --driver ipvlan --subnet=10.5.74.0/24 -o parent=${parent_interface}
# The following creates an ipvlan network with eth0 on host as parent.
local macvlan_net_name="macvlan20"
info "Creating macvlan network with eth0 interface on host as parent"
sudo nerdctl network create ${macvlan_net_name=} --driver ipvlan --subnet=10.8.0.0/24 -o parent=${parent_interface}
sudo nerdctl network create ${macvlan_net_name} --driver ipvlan --subnet=10.8.0.0/24 -o parent=${parent_interface}
enabling_hypervisor
@ -111,6 +111,9 @@ function run() {
info "Running nerdctl with Kata Containers (${KATA_HYPERVISOR}) and macvlan network"
sudo nerdctl run --rm --net ${macvlan_net_name} --runtime io.containerd.kata-${KATA_HYPERVISOR}.v2 alpine ip a | grep "eth0"
info "Removing networks"
sudo nerdctl network rm ${macvlan_net_name} ${ipvlan_net_name}
}
function main() {