Skip to content

Commit

Permalink
KIC 2.0 - Proxy interface and Async Cache Resolution Server (#1274)
Browse files Browse the repository at this point in the history
The new Proxy interface allows async implementations that controllers and a controller-runtime based
controller managers can use to update the Kong Proxy's Admin APIs using only K8s objects and having
no need to understand Kong DSL.
  • Loading branch information
shaneutt authored May 4, 2021
1 parent bc62211 commit bbe221f
Show file tree
Hide file tree
Showing 12 changed files with 553 additions and 411 deletions.
44 changes: 43 additions & 1 deletion pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,49 @@ func (c CacheStores) Add(obj runtime.Object) error {
case *knative.Ingress:
return c.KnativeIngress.Add(obj)
default:
return fmt.Errorf("cannot add kind %q to the store", obj.GetObjectKind().GroupVersionKind())
return fmt.Errorf("cannot add unsupported kind %q to the store", obj.GetObjectKind().GroupVersionKind())
}
}

// Delete removes a provided runtime.Object from the CacheStore if it's of a supported type.
// The CacheStore must be initialized (see NewCacheStores()) or this will panic.
func (c CacheStores) Delete(obj runtime.Object) error {
switch obj := obj.(type) {
// ----------------------------------------------------------------------------
// Kubernetes Core API Support
// ----------------------------------------------------------------------------
case *extensions.Ingress:
return c.IngressV1beta1.Delete(obj)
case *networkingv1.Ingress:
return c.IngressV1.Delete(obj)
case *corev1.Service:
return c.Service.Delete(obj)
case *corev1.Secret:
return c.Secret.Delete(obj)
case *corev1.Endpoints:
return c.Endpoint.Delete(obj)
// ----------------------------------------------------------------------------
// Kong API Support
// ----------------------------------------------------------------------------
case *kongv1.KongPlugin:
return c.Plugin.Delete(obj)
case *kongv1.KongClusterPlugin:
return c.ClusterPlugin.Delete(obj)
case *kongv1.KongConsumer:
return c.Consumer.Delete(obj)
case *kongv1.KongIngress:
return c.KongIngress.Delete(obj)
case *kongv1beta1.TCPIngress:
return c.TCPIngress.Delete(obj)
case *kongv1alpha1.UDPIngress:
return c.UDPIngress.Delete(obj)
// ----------------------------------------------------------------------------
// 3rd Party API Support
// ----------------------------------------------------------------------------
case *knative.Ingress:
return c.KnativeIngress.Delete(obj)
default:
return fmt.Errorf("cannot delete unsupported kind %q from the store", obj.GetObjectKind().GroupVersionKind())
}
}

Expand Down
Loading

0 comments on commit bbe221f

Please sign in to comment.