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: ApisixRouteEvent type assertion #925

Merged
merged 1 commit into from
Mar 18, 2022
Merged

Conversation

tao12345666333
Copy link
Member

Signed-off-by: Jintao Zhang zhangjintao9020@gmail.com

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

fixes #924

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@tao12345666333 tao12345666333 added this to In progress in v1.5 Planning via automation Mar 17, 2022
@tao12345666333 tao12345666333 added this to the 1.5.0 milestone Mar 17, 2022
@nayihz
Copy link
Contributor

nayihz commented Mar 18, 2022

func (c *apisixRouteController) handleSyncErr(obj interface{}, errOrigin error) {
ev := obj.(*types.Event)
event := ev.Object.(kube.ApisixRouteEvent)
if k8serrors.IsNotFound(errOrigin) && ev.Type != types.EventDelete {
log.Infow("sync ApisixRoute but not found, ignore",
zap.String("event_type", ev.Type.String()),
zap.String("ApisixRoute", ev.Object.(string)),
)
c.workqueue.Forget(event)
return
}

We will delete this event from workqueue if we have an ApisixRoute resources without any valid backends. It is reasonable?

@tao12345666333
Copy link
Member Author

func (c *apisixRouteController) handleSyncErr(obj interface{}, errOrigin error) {
ev := obj.(*types.Event)
event := ev.Object.(kube.ApisixRouteEvent)
if k8serrors.IsNotFound(errOrigin) && ev.Type != types.EventDelete {
log.Infow("sync ApisixRoute but not found, ignore",
zap.String("event_type", ev.Type.String()),
zap.String("ApisixRoute", ev.Object.(string)),
)
c.workqueue.Forget(event)
return
}

We will delete this event from workqueue if we have an ApisixRoute resources without any valid backends. It is reasonable?

@cmssczy This change is to fix the #810 and was introduced in #893

This does cause some problems.

For example, create an ApisixRoute first, which references a service that does not exist.
But when a Service is created, the APISIX Ingress controller can't actually create a route.

@nayihz
Copy link
Contributor

nayihz commented Mar 18, 2022

But when a Service is created, the APISIX Ingress controller can't actually create a route

That's it.

@tao12345666333
Copy link
Member Author

@cmssczy I created #926 to track it, let's discuss it in #926

v1.5 Planning automation moved this from In progress to Reviewer approved Mar 18, 2022
@gxthrj gxthrj merged commit 2178857 into apache:master Mar 18, 2022
v1.5 Planning automation moved this from Reviewer approved to Done Mar 18, 2022
@tao12345666333 tao12345666333 deleted the fix-panic branch March 18, 2022 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

bug: panic when apisixRoute resource's backends is not existed
4 participants