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 #2921
This commit is contained in:
parent
4f896655d1
commit
319ad158f0
2 changed files with 3 additions and 3 deletions
pkg/prometheus
|
@ -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
|
||||
|
|
|
@ -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`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue