Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithLogger ¶
Types ¶
type Client ¶
type Client interface { Create(ctx context.Context, res k8s.Resource, options ...k8s.Option) error Get(ctx context.Context, name string, res k8s.Resource, options ...k8s.Option) error Update(ctx context.Context, res k8s.Resource, options ...k8s.Option) error Delete(ctx context.Context, res k8s.Resource, options ...k8s.Option) error Watch(ctx context.Context, res k8s.Resource) (Watcher, error) }
func FromK8sClient ¶ added in v1.1.0
FromK8sClient provides an implementation of the Client interface backed by the provided *k8s.Client.
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func (*Operator) Client ¶
Client returns a client for the Kubernetes API you can use in your handlers.
type Option ¶
type Option func(op *Operator)
func WithClient ¶
func WithClient(client interface{}) Option
WithClient configures an operator to use the specified client to communicate with the Kubernetes API. This option accepts an *k8s.Client as well as anything implementing the Client interface and panics for any other values. It is required and New panics if it is not provided.
func WithLogger ¶
WithLogger configures an operator to use the specified logger. This option is optional and defaults to using the standard library's log package.
func WithReconciler ¶
func WithReconciler(r Reconciler) Option
WithReconciler configures the operator to use the specified reconciler. As an operator can only have one reconciler, when specifying this option multiple times, the last option wins.
func WithResource ¶
WithResource configures an operator to watch for changes of the specified resource type. This option is required and New will panic if it is not provided.