Skip to content

Commit

Permalink
only set thanos web.route-prefix if it was set by user
Browse files Browse the repository at this point in the history
Due to a problem in the way thanos handles a web.route-prefix set
to '/' (thanos-io/thanos#2207), the value
 should only set if the user has set a value for it.  If it's set
to empty string, no argument should be passed, so that thanos
uses it's own default value.
  • Loading branch information
pgier committed Mar 2, 2020
1 parent ec88641 commit 977244e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/thanos/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,14 @@ func makeStatefulSetSpec(tr *monitoringv1.ThanosRuler, config Config, ruleConfig
})
}

webRoutePrefix := "/"
if tr.Spec.RoutePrefix != "" {
webRoutePrefix = tr.Spec.RoutePrefix
trCLIArgs = append(trCLIArgs, fmt.Sprintf("--web.route-prefix=%s", tr.Spec.RoutePrefix))
}
trCLIArgs = append(trCLIArgs, fmt.Sprintf("--web.route-prefix=%s", webRoutePrefix))

localReloadURL := &url.URL{
Scheme: "http",
Host: config.LocalHost + ":10902",
Path: path.Clean(webRoutePrefix + "/-/reload"),
Path: path.Clean(tr.Spec.RoutePrefix + "/-/reload"),
}

additionalContainers := []v1.Container{}
Expand Down

0 comments on commit 977244e

Please sign in to comment.