Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-johan-grahn committed Dec 16, 2024
1 parent 503f4df commit 4aed25b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/kube/wrappers/routeWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func (rw *RouteWrapper) GetURL(forceHttps bool, healthEndpoint string) string {

// Convert url to url object
u, err := url.Parse(URL)
log.Info(fmt.Sprintf("rw.getRouteSubPath(): %s", rw.getRouteSubPath()))

if err != nil {
log.Info(fmt.Sprintf("URL parsing error in getURL() :%v", err))
Expand All @@ -120,14 +119,20 @@ func (rw *RouteWrapper) GetURL(forceHttps bool, healthEndpoint string) string {
u.Path = healthEndpoint
} else {
// Append subpath
log.Info(fmt.Sprintf("u.EscapedPath(): %s", u.EscapedPath()))
log.Info(fmt.Sprintf("rw.getRouteSubPath(): %s", rw.getRouteSubPath()))
u.Path = path.Join(u.EscapedPath(), rw.getRouteSubPath())
log.Info(fmt.Sprintf("u.Path: %s", u.Path))

// Find pod by backtracking route -> service -> pod
healthEndpoint, exists := rw.tryGetHealthEndpointFromRoute()

// Health endpoint from pod successful
if exists {
log.Info(fmt.Sprintf("u.EscapedPath(): %s", u.EscapedPath()))
log.Info(fmt.Sprintf("healthEndpoint: %s", healthEndpoint))
u.Path = path.Join(u.EscapedPath(), healthEndpoint)
log.Info(fmt.Sprintf("u.Path: %s", u.Path))
}
}
log.Info(fmt.Sprintf("u.String(): %s", u.String()))
Expand Down

0 comments on commit 4aed25b

Please sign in to comment.