Skip to content

Commit

Permalink
Merge pull request #672 from EdwinWalela/dev
Browse files Browse the repository at this point in the history
remove hostname hyphen split block
  • Loading branch information
Paulo Gomes authored Apr 14, 2022
2 parents a0070ce + 9c4dfc0 commit 2f4a337
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"time"

"github.com/go-logr/logr"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2f4a337

Please sign in to comment.