Skip to content

Commit

Permalink
Simplify DaemonHost to use URL.Hostname
Browse files Browse the repository at this point in the history
PR requested change
  • Loading branch information
pnasrat committed Oct 26, 2023
1 parent a1093a6 commit bd4d9c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/drivers/kic/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down

0 comments on commit bd4d9c6

Please sign in to comment.