remove hostname hyphen split block
Signed-off-by: edwinwalela <edwinwalela@gmail.com>
This commit is contained in:
parent
a0070ce5fe
commit
9c4dfc02f2
9
main.go
9
main.go
|
@ -22,7 +22,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-logr/logr"
|
"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 {
|
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)
|
host, port, err := net.SplitHostPort(storageAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Error(err, "unable to parse storage address")
|
l.Error(err, "unable to parse storage address")
|
||||||
|
|
Loading…
Reference in New Issue