From 936d2a8e2f2bcb82c508f2d221ebce76717297a4 Mon Sep 17 00:00:00 2001 From: Sylvester Carolan Date: Sun, 8 Sep 2024 14:16:05 -0400 Subject: [PATCH] Set warnSlow flag to try when deleting a profile and in DeleteContainersByLabel. --- pkg/drivers/kic/oci/oci.go | 3 ++- pkg/minikube/delete/delete.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index 3fcbe63b3251..4bf022ca1cb2 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -45,7 +45,8 @@ import ( func DeleteContainersByLabel(ociBin string, label string) []error { var deleteErrs []error ctx := context.Background() - cs, err := ListContainersByLabel(ctx, ociBin, label) + //set warnSlow to true to give a warning for slow dockers + cs, err := ListContainersByLabel(ctx, ociBin, label, true) if err != nil { return []error{fmt.Errorf("listing containers by label %q", label)} } diff --git a/pkg/minikube/delete/delete.go b/pkg/minikube/delete/delete.go index 95dc688f8e53..348baa2dad70 100644 --- a/pkg/minikube/delete/delete.go +++ b/pkg/minikube/delete/delete.go @@ -47,7 +47,8 @@ func PossibleLeftOvers(ctx context.Context, cname string, driverName string) { klog.Infof("deleting possible leftovers for %s (driver=%s) ...", cname, driverName) delLabel := fmt.Sprintf("%s=%s", oci.ProfileLabelKey, cname) - cs, err := oci.ListContainersByLabel(ctx, bin, delLabel) + //set warnSlow to true to enable slow docker warning + cs, err := oci.ListContainersByLabel(ctx, bin, delLabel, true) if err == nil && len(cs) > 0 { for _, c := range cs { out.Step(style.DeletingHost, `Deleting container "{{.name}}" ...`, out.V{"name": cname})