1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 11:48:53 +00:00

operator: modified prometheus wget probe when listenLocal

When using prometheus with listenLocal=true the wget probe in the pod
failed because the created download file prenvents further successfull
wget runs.
Using /dev/null for the wget output file fixes that.

Fixes 
This commit is contained in:
Karl-Fried Eisenhauer 2019-12-31 14:20:34 +01:00
parent 4f896655d1
commit 319ad158f0
2 changed files with 3 additions and 3 deletions

View file

@ -616,7 +616,7 @@ func makeStatefulSetSpec(p monitoringv1.Prometheus, c *Config, ruleConfigMapName
fmt.Sprintf("--config-envsubst-file=%s", path.Join(confOutDir, configEnvsubstFilename)),
}
const localProbe = `if [ -x "$(command -v curl)" ]; then curl %s; elif [ -x "$(command -v wget)" ]; then wget -q %s; else exit 1; fi`
const localProbe = `if [ -x "$(command -v curl)" ]; then curl %s; elif [ -x "$(command -v wget)" ]; then wget -q -O /dev/null %s; else exit 1; fi`
var livenessProbeHandler v1.Handler
var readinessProbeHandler v1.Handler

View file

@ -406,7 +406,7 @@ func TestListenLocal(t *testing.T) {
Command: []string{
`sh`,
`-c`,
`if [ -x "$(command -v curl)" ]; then curl http://localhost:9090/-/ready; elif [ -x "$(command -v wget)" ]; then wget -q http://localhost:9090/-/ready; else exit 1; fi`,
`if [ -x "$(command -v curl)" ]; then curl http://localhost:9090/-/ready; elif [ -x "$(command -v wget)" ]; then wget -q -O /dev/null http://localhost:9090/-/ready; else exit 1; fi`,
},
},
},
@ -425,7 +425,7 @@ func TestListenLocal(t *testing.T) {
Command: []string{
`sh`,
`-c`,
`if [ -x "$(command -v curl)" ]; then curl http://localhost:9090/-/healthy; elif [ -x "$(command -v wget)" ]; then wget -q http://localhost:9090/-/healthy; else exit 1; fi`,
`if [ -x "$(command -v curl)" ]; then curl http://localhost:9090/-/healthy; elif [ -x "$(command -v wget)" ]; then wget -q -O /dev/null http://localhost:9090/-/healthy; else exit 1; fi`,
},
},
},