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: use networking informer instead of extensions #296

Merged
merged 1 commit into from Mar 15, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -51,6 +51,10 @@ This project is currently considered experimental.

<img src="./docs/assets/images/apisix-ingress-controller-arch.png" alt="module" width="600" height="313" />

## Prerequisites

Apisix ingress controller requires Kubernetes version 1.14+.

## Get started

* [How to install](./install.md)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingress/controller/controller.go
Expand Up @@ -137,7 +137,7 @@ func NewController(cfg *config.Config) (*Controller, error) {
if cfg.Kubernetes.IngressVersion == config.IngressNetworkingV1 {
ingressInformer = kube.CoreSharedInformerFactory.Networking().V1().Ingresses().Informer()
} else {
ingressInformer = kube.CoreSharedInformerFactory.Extensions().V1beta1().Ingresses().Informer()
ingressInformer = kube.CoreSharedInformerFactory.Networking().V1beta1().Ingresses().Informer()
junnplus marked this conversation as resolved.
Show resolved Hide resolved
}
if cfg.Kubernetes.ApisixRouteVersion == config.ApisixRouteV2alpha1 {
apisixRouteInformer = sharedInformerFactory.Apisix().V2alpha1().ApisixRoutes().Informer()
Expand Down
4 changes: 2 additions & 2 deletions pkg/ingress/controller/ingress.go
Expand Up @@ -165,7 +165,7 @@ func (c *ingressController) syncToCluster(ctx context.Context, clusterName strin
}
for _, u := range upstreams {
old, err := c.controller.apisix.Cluster(clusterName).Upstream().Get(ctx, u.FullName)
if err == nil && err != apisixcache.ErrNotFound {
if err != nil && err != apisixcache.ErrNotFound {
return err
}
if old == nil {
Expand All @@ -180,7 +180,7 @@ func (c *ingressController) syncToCluster(ctx context.Context, clusterName strin
}
for _, r := range routes {
old, err := c.controller.apisix.Cluster(clusterName).Route().Get(ctx, r.FullName)
if err == nil && err != apisixcache.ErrNotFound {
if err != nil && err != apisixcache.ErrNotFound {
return err
}
if old == nil {
Expand Down