Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Scheme = runtime.NewScheme()
Scheme to use for building k8s ClientSets.
Functions ¶
Types ¶
type Context ¶
type Context interface {
// ClientSet for a subset of resource kinds. Must implement Get and List methods.
ClientSet() client.Client
// GetAttachment for a specific resource that any controller added during the Reconcile
// invocation.
GetAttachment(kind, namespace, name string) (any, bool)
// GetResource with specific kind, namespace and name. Use this over ClientSet().Get(...) if the
// ApiVersion of a resource is unknown or ambiguous. Returns the first resource matched in a resource tree.
GetResource(kind, namespace, name string) (*Resource, bool)
}
type Controller ¶
type Controller interface {
// Kinds this controller will accept. Only resources of this API kind will be handled, e.g. "Secret",
// "Kustomization". Scope a controller as narrow as possible.
Kinds() []string
// Reconcile is invoked for each resource. Returns a list of resources to create
// and an error. If error is ErrSkip, the controller is skipped for this invocation.
Reconcile(Context, *Resource) (*Result, error)
}
Controller defines a reconciliation loop.
type Resource ¶
Resource that contains a single arbitrary k8s manifest.
func NewResource ¶
NewResource from a kustomize resource.
func NewResources ¶
NewResources from kustomize resources.
func (Resource) Unstructured ¶
func (r Resource) Unstructured() (*unstructured.Unstructured, error)
Unstructured representation of this resource.
type Result ¶
type Result struct {
// Resources that are created based on the handled resource, e.g. ExternalSecret creates a Secret.
Resources []*Resource
// Attachment that should be stored alongside this resource node, or nil. Attachments can be retrieved
// using Context.GetAttachment.
Attachment any
}
Result of a single reconciliation.
Click to show internal directories.
Click to hide internal directories.