From dafbe6aac313d0706bd58161781ab6b0be063800 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 29 Sep 2021 13:47:59 -0700 Subject: [PATCH 1/2] add created by label for podman --- pkg/drivers/kic/oci/network_create.go | 4 +--- pkg/minikube/delete/delete.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/drivers/kic/oci/network_create.go b/pkg/drivers/kic/oci/network_create.go index 494f90f56d52..245506fd889d 100644 --- a/pkg/drivers/kic/oci/network_create.go +++ b/pkg/drivers/kic/oci/network_create.go @@ -123,10 +123,8 @@ func tryCreateDockerNetwork(ociBin string, subnet *network.Parameters, mtu int, args = append(args, "-o") args = append(args, fmt.Sprintf("com.docker.network.driver.mtu=%d", mtu)) } - - args = append(args, fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true")) } - args = append(args, name) + args = append(args, fmt.Sprintf("--label=%s=%s", CreatedByLabelKey, "true"), name) rr, err := runCmd(exec.Command(ociBin, args...)) if err != nil { diff --git a/pkg/minikube/delete/delete.go b/pkg/minikube/delete/delete.go index 48ddd69593b8..cd6000496c26 100644 --- a/pkg/minikube/delete/delete.go +++ b/pkg/minikube/delete/delete.go @@ -28,7 +28,7 @@ import ( "k8s.io/minikube/pkg/minikube/style" ) -// PossibleLeftOvers deletes KIC & non-KIC drivers left +// PossibleLeftOvers deletes KIC driver left overs func PossibleLeftOvers(ctx context.Context, cname string, driverName string) { bin := "" switch driverName { From 3a90f8c1bfb0d08d304dce29a31e0ba5597a78ba Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 29 Sep 2021 14:42:44 -0700 Subject: [PATCH 2/2] add test to check for existing networks --- test/integration/pause_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/integration/pause_test.go b/test/integration/pause_test.go index b125c7dc4e5c..3e62a2ebb0db 100644 --- a/test/integration/pause_test.go +++ b/test/integration/pause_test.go @@ -173,6 +173,13 @@ func validateVerifyDeleted(ctx context.Context, t *testing.T, profile string) { t.Errorf("expected to see error and volume %q to not exist after deletion but got no error and this output: %s", rr.Command(), rr.Output()) } + rr, err = Run(t, exec.CommandContext(ctx, "sudo", bin, "network", "ls")) + if err != nil { + t.Errorf("failed to get list of networks: %v", err) + } + if strings.Contains(rr.Output(), profile) { + t.Errorf("expected network %q to not exist after deletion but contained: %s", profile, rr.Output()) + } } }