From 9c4dfc02f224e2123740a9f6456e1c84b2d9b43c Mon Sep 17 00:00:00 2001 From: edwinwalela Date: Thu, 14 Apr 2022 11:11:01 +0300 Subject: [PATCH] remove hostname hyphen split block Signed-off-by: edwinwalela --- main.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main.go b/main.go index 5b6af0e39..ccd579df4 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,6 @@ import ( "net/http" "os" "path/filepath" - "strings" "time" "github.com/go-logr/logr" @@ -312,14 +311,6 @@ func mustInitStorage(path string, storageAdvAddr string, artifactRetentionTTL ti } func determineAdvStorageAddr(storageAddr string, l logr.Logger) string { - // TODO(hidde): remove next MINOR prerelease as it can be passed in using - // Kubernetes' substitution. - if os.Getenv("RUNTIME_NAMESPACE") != "" { - svcParts := strings.Split(os.Getenv("HOSTNAME"), "-") - return fmt.Sprintf("%s.%s", - strings.Join(svcParts[:len(svcParts)-2], "-"), os.Getenv("RUNTIME_NAMESPACE")) - } - host, port, err := net.SplitHostPort(storageAddr) if err != nil { l.Error(err, "unable to parse storage address")