remove hostname hyphen split block

Signed-off-by: edwinwalela <edwinwalela@gmail.com>
This commit is contained in:
edwinwalela 2022-04-14 11:11:01 +03:00
parent a0070ce5fe
commit 9c4dfc02f2
1 changed files with 0 additions and 9 deletions

View File

@ -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")