Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hostname hyphen split block #672

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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