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: Avoid retrying caused by 404 when deleting cache #424

Merged
merged 3 commits into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/apisix/global_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ func (r *globalRuleClient) Delete(ctx context.Context, obj *v1.GlobalRule) error
}
if err := r.cluster.cache.DeleteGlobalRule(obj); err != nil {
log.Errorf("failed to reflect global_rule delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apisix/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ func (r *routeClient) Delete(ctx context.Context, obj *v1.Route) error {
}
if err := r.cluster.cache.DeleteRoute(obj); err != nil {
log.Errorf("failed to reflect route delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apisix/ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func (s *sslClient) Delete(ctx context.Context, obj *v1.Ssl) error {
}
if err := s.cluster.cache.DeleteSSL(obj); err != nil {
log.Errorf("failed to reflect ssl delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apisix/stream_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ func (r *streamRouteClient) Delete(ctx context.Context, obj *v1.StreamRoute) err
}
if err := r.cluster.cache.DeleteStreamRoute(obj); err != nil {
log.Errorf("failed to reflect stream_route delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apisix/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ func (u *upstreamClient) Delete(ctx context.Context, obj *v1.Upstream) error {
}
if err := u.cluster.cache.DeleteUpstream(obj); err != nil {
log.Errorf("failed to reflect upstream delete to cache: %s", err.Error())
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down