Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequeueingMiddleware ¶
func NewRequeueingMiddleware(logger hclog.Logger, reconciler reconcile.Reconciler) reconcile.Reconciler
NewSyncRequeuingMiddleware handles delaying requeues in the case of synchronization errors in order to not block the reconciliation loop
Types ¶
type Client ¶
type Client interface { // getters GetGatewayClassConfig(ctx context.Context, key types.NamespacedName) (*apigwv1alpha1.GatewayClassConfig, error) GetGatewayClass(ctx context.Context, key types.NamespacedName) (*gateway.GatewayClass, error) GetGateway(ctx context.Context, key types.NamespacedName) (*gateway.Gateway, error) GetSecret(ctx context.Context, key types.NamespacedName) (*core.Secret, error) GetService(ctx context.Context, key types.NamespacedName) (*core.Service, error) GetHTTPRoute(ctx context.Context, key types.NamespacedName) (*gateway.HTTPRoute, error) GetHTTPRoutesInNamespace(ctx context.Context, ns string) ([]gateway.HTTPRoute, error) GetTCPRoute(ctx context.Context, key types.NamespacedName) (*gateway.TCPRoute, error) GetTCPRoutesInNamespace(ctx context.Context, ns string) ([]gateway.TCPRoute, error) GetMeshService(ctx context.Context, key types.NamespacedName) (*apigwv1alpha1.MeshService, error) GetNamespace(ctx context.Context, key types.NamespacedName) (*core.Namespace, error) GatewayClassInUse(ctx context.Context, gc *gateway.GatewayClass) (bool, error) GatewayClassConfigInUse(ctx context.Context, gcc *apigwv1alpha1.GatewayClassConfig) (bool, error) GatewayClassesUsingConfig(ctx context.Context, gcc *apigwv1alpha1.GatewayClassConfig) (*gateway.GatewayClassList, error) RemoveFinalizer(ctx context.Context, object client.Object, finalizer string) (bool, error) EnsureFinalizer(ctx context.Context, object client.Object, finalizer string) (bool, error) HasManagedDeployment(ctx context.Context, gw *gateway.Gateway) (bool, error) IsManagedRoute(ctx context.Context, namespace string, parents []gateway.ParentRef) (bool, error) GetConfigForGatewayClassName(ctx context.Context, name string) (apigwv1alpha1.GatewayClassConfig, bool, error) DeploymentForGateway(ctx context.Context, gw *gateway.Gateway) (*apps.Deployment, error) SetControllerOwnership(owner, object client.Object) error PodWithLabels(ctx context.Context, labels map[string]string) (*core.Pod, error) UpdateStatus(ctx context.Context, obj client.Object) error Update(ctx context.Context, obj client.Object) error CreateOrUpdateDeployment(ctx context.Context, deployment *apps.Deployment, mutators ...func() error) (bool, error) CreateOrUpdateService(ctx context.Context, service *core.Service, mutators ...func() error) (bool, error) DeleteService(ctx context.Context, service *core.Service) error EnsureServiceAccount(ctx context.Context, owner *gateway.Gateway, serviceAccount *core.ServiceAccount) error //referencepolicy GetReferencePoliciesInNamespace(ctx context.Context, namespace string) ([]gateway.ReferencePolicy, error) }
Client is an abstraction around interactions with Kubernetes APIs. In order to keep the error boundaries clear for our reconciliation code, care should be taken to wrap all returned errors in a K8sError type so that any Kubernetes API errors can be retried immediately.
func NewTestClient ¶ added in v0.2.0
func NewTestClient(list client.ObjectList, objects ...client.Object) Client
type K8sError ¶
type K8sError struct {
// contains filtered or unexported fields
}
K8sError is an error type that should wrap any Kubernetes API errors that the gatewayclient returns -- they're caught in the requeueing middleware to be retried immediately rather than with a delayed requeue.
func NewK8sError ¶
Click to show internal directories.
Click to hide internal directories.