Skip to content
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

fix reconcilePrimaryHpa doesn't fall back to v2beta2 #1238

Closed
wants to merge 0 commits into from
Closed

Conversation

c19
Copy link

@c19 c19 commented Jul 19, 2022

So the problems is I'm using flagger 1.22 on a 1.19 eks. which doesn't has hpa v2, but has hpa v2beta2.
from the falling back to v2beta2 log and latter creating HorizontalPodAutoscaler v2 log. we can tell that it's not going to the expected if branch. which I think it's due to failed hpa query while has error, still return something for hpa.

log:

{"level":"debug","ts":"2022-07-19T07:28:06.449Z","caller":"canary/hpa_reconciler.go:41","msg":"v2 HorizontalPodAutoscaler apps.my-app get query error: %!w(*errors.StatusError=&{{{ } {   <nil>} Failure the server could not find the requested resource NotFound 0xc0002e58c0 404}}); falling back to v2beta2"}
{"level":"info","ts":"2022-07-19T07:28:06.459Z","caller":"controller/events.go:45","msg":"creating HorizontalPodAutoscaler v2 my-app-primary.apps failed: the server could not find the requested resource","canary":"my-app.apps"}
{"level":"debug","ts":"2022-07-19T07:28:06.459Z","logger":"event-broadcaster","caller":"record/event.go:285","msg":"Event(v1.ObjectReference{Kind:\"Canary\", Namespace:\"apps\", Name:\"my-app\", UID:\"324fcec9-3d8f-479f-879d-c9fdad3e3ee9\", APIVersion:\"flagger.app/v1beta1\", ResourceVersion:\"1058290968\", FieldPath:\"\"}): type: 'Warning' reason: 'Synced' creating HorizontalPodAutoscaler v2 my-app-primary.apps failed: the server could not find the requested resource"}

I tested on my 1.19 eks. works fine.

@c19 c19 requested a review from stefanprodan as a code owner July 19, 2022 07:41
Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @c19, thanks for catching the issue and opening this PR! Please sign off your commit.

hpa = nil;
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %w; falling back to v2beta2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hpa = nil;
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %w; falling back to v2beta2",
hpa = nil
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %s; falling back to v2beta2",

@aryan9600
Copy link
Member

Superseded by #1242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants