Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman: Fix network not getting deleted #12627

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/drivers/kic/oci/network_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions test/integration/pause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

}
Expand Down