-
Notifications
You must be signed in to change notification settings - Fork 591
/
dataplane.go
33 lines (26 loc) · 1017 Bytes
/
dataplane.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package controllers
import (
"context"
"github.com/kong/go-kong/kong"
"sigs.k8s.io/controller-runtime/pkg/client"
k8sobj "github.com/kong/kubernetes-ingress-controller/v3/internal/util/kubernetes/object"
)
// DataPlane is a common interface that is used by reconcilers to interact
// with the Kong dataplane.
type DataPlane interface {
DataPlaneClient
DataPlaneStatusClient
Listeners(ctx context.Context) ([]kong.ProxyListener, []kong.StreamListener, error)
}
type DataPlaneStatusClient interface {
AreKubernetesObjectReportsEnabled() bool
KubernetesObjectConfigurationStatus(obj client.Object) k8sobj.ConfigurationStatus
KubernetesObjectIsConfigured(obj client.Object) bool
}
// DataPlaneClient is a common client interface that is used by reconcilers to interact
// with the Kong dataplane to perform CRUD operations on provided objects.
type DataPlaneClient interface {
UpdateObject(obj client.Object) error
DeleteObject(obj client.Object) error
ObjectExists(obj client.Object) (bool, error)
}