From bd4d9c69c17988a2a84690e6ab44a812c0268c9d Mon Sep 17 00:00:00 2001 From: Pris Nasrat Date: Thu, 26 Oct 2023 12:57:42 -0400 Subject: [PATCH] Simplify DaemonHost to use URL.Hostname PR requested change --- pkg/drivers/kic/oci/oci.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/drivers/kic/oci/oci.go b/pkg/drivers/kic/oci/oci.go index 27730048a819..24a527e87de2 100644 --- a/pkg/drivers/kic/oci/oci.go +++ b/pkg/drivers/kic/oci/oci.go @@ -701,10 +701,8 @@ func DaemonHost(driver string) string { if driver == Docker { if dh := os.Getenv(constants.DockerHostEnv); dh != "" { if u, err := url.Parse(dh); err == nil { - if u.Host != "" { - if hostname := u.Hostname(); hostname != "" { - return u.Hostname() - } + if u.Hostname() != "" { + return u.Hostname() } } }