-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
sidecar: set to not ready when failing to fetch prometheus version #7291
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Samuel Scard <10246309+SamJamS@users.noreply.github.com>
Signed-off-by: Samuel Scard <10246309+SamJamS@users.noreply.github.com>
|
||
// Start sidecar without ever starting Prometheus. | ||
_, sidecar := e2ethanos.NewPrometheusWithSidecar(e, "alone", e2ethanos.DefaultPromConfig("prom-alone", 0, "", "", e2ethanos.LocalPrometheusTarget), "", e2ethanos.DefaultPrometheusImage(), "") | ||
testutil.Ok(t, sidecar.Start()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use e2e.StartAndWaitReady()
here, relying on sidecar's health endpoint as readiness check to make sure we have a running sidecar before testing?
@@ -189,6 +189,8 @@ func runSidecar( | |||
"msg", "failed to fetch prometheus version. Is Prometheus running? Retrying", | |||
"err", err, | |||
) | |||
promUp.Set(0) | |||
statusProber.NotReady(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can update here or default readiness to false at the beginning of runSidecar()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does #7323 solve your problem?
Changes
Update ready state in "fetch prometheus version" loop - Currently, if no ready Prometheus behind sidecar then this loops indefinitely and never sets sidecar as
not ready
. As a result, sidecar reports asready
if it starts up and there is not a running Prometheus behind it.Verification