Merge pull request #12627 from spowelljr/deletePodmanNetwork

podman: Fix network not getting deleted
pull/12641/head
Steven Powell 2021-09-30 14:51:51 -07:00 committed by GitHub
commit 7544e72e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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())
}
}
}