Documentation
¶
Index ¶
- func CheckUID(target Target, observed metav1.Object) error
- func Delete(ctx context.Context, c *config.Configuration, target Target, ...) error
- func EnvRegistration[In EnvResource, Out *EnvResourceOutput, P any](base runtime.ResourceRegistration, ...) envRegistration[P]
- func FieldValues(obj *unstructured.Unstructured, fields string) (map[string]any, error)
- func ObjectRegistration[In ObjectResource, Out *ObjectResourceOutput, P any](base runtime.ResourceRegistration, ...) objectRegistration[P]
- func OwnedFields(obj *unstructured.Unstructured, manager string) (string, error)
- type APIResourceRow
- type APIResourcesDataSource
- type APIResourcesDataSourceOutput
- type AnnotationsResource
- func (r AnnotationsResource) Constraints() []constraint.Constraint
- func (r *AnnotationsResource) Create(ctx context.Context, c *config.Configuration) (*AnnotationsResourceOutput, error)
- func (r AnnotationsResource) Defaults() []defaults.Default
- func (r *AnnotationsResource) Delete(ctx context.Context, c *config.Configuration, p annotationsPrior) error
- func (r *AnnotationsResource) Read(ctx context.Context, c *config.Configuration, p annotationsPrior) (*AnnotationsResourceOutput, error)
- func (r *AnnotationsResource) ResourceDefinition() ...
- func (r *AnnotationsResource) Update(ctx context.Context, c *config.Configuration, p annotationsPrior) (*AnnotationsResourceOutput, error)
- type AnnotationsResourceOutput
- type Client
- type EnvFieldRef
- type EnvKeyRef
- type EnvResource
- func (r EnvResource) Constraints() []constraint.Constraint
- func (r *EnvResource) Create(ctx context.Context, c *config.Configuration) (*EnvResourceOutput, error)
- func (r EnvResource) Defaults() []defaults.Default
- func (*EnvResource) Delete(ctx context.Context, c *config.Configuration, p envPrior) error
- func (r *EnvResource) Read(ctx context.Context, c *config.Configuration, p envPrior) (*EnvResourceOutput, error)
- func (*EnvResource) ResourceDefinition() ...
- func (r *EnvResource) Update(ctx context.Context, c *config.Configuration, p envPrior) (*EnvResourceOutput, error)
- type EnvResourceFieldRef
- type EnvResourceOutput
- type EnvValueFrom
- type EnvVar
- type LabelsResource
- func (r LabelsResource) Constraints() []constraint.Constraint
- func (r *LabelsResource) Create(ctx context.Context, c *config.Configuration) (*LabelsResourceOutput, error)
- func (r LabelsResource) Defaults() []defaults.Default
- func (r *LabelsResource) Delete(ctx context.Context, c *config.Configuration, p labelsPrior) error
- func (r *LabelsResource) Read(ctx context.Context, c *config.Configuration, p labelsPrior) (*LabelsResourceOutput, error)
- func (r *LabelsResource) ResourceDefinition() ...
- func (r *LabelsResource) Update(ctx context.Context, c *config.Configuration, p labelsPrior) (*LabelsResourceOutput, error)
- type LabelsResourceOutput
- type ObjectDataSource
- type ObjectDataSourceOutput
- type ObjectLookupMetadata
- type ObjectResource
- func (r *ObjectResource) Create(ctx context.Context, c *config.Configuration) (*ObjectResourceOutput, error)
- func (r *ObjectResource) Delete(ctx context.Context, c *config.Configuration, p prior) error
- func (r *ObjectResource) Read(ctx context.Context, c *config.Configuration, p prior) (*ObjectResourceOutput, error)
- func (r *ObjectResource) ResourceDefinition() ...
- func (r *ObjectResource) Update(ctx context.Context, c *config.Configuration, p prior) (*ObjectResourceOutput, error)
- type ObjectResourceOutput
- type ObjectsDataSource
- type ObjectsDataSourceOutput
- type Target
- type WaitAction
- type WaitActionOutput
- type WaitCondition
- type WaitField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete( ctx context.Context, c *config.Configuration, target Target, options metav1.DeleteOptions, timeout time.Duration, ) error
func EnvRegistration ¶
func EnvRegistration[In EnvResource, Out *EnvResourceOutput, P any]( base runtime.ResourceRegistration, read func(context.Context, any, any, P) (any, error), known func(any, any, P, map[string][]string, bool) ([]string, error), ) envRegistration[P]
EnvRegistration uses the saved REST scope to classify namespace edits.
func FieldValues ¶
func FieldValues(obj *unstructured.Unstructured, fields string) (map[string]any, error)
func ObjectRegistration ¶ added in v0.2.0
func ObjectRegistration[In ObjectResource, Out *ObjectResourceOutput, P any]( base runtime.ResourceRegistration, read func(context.Context, any, any, P) (any, error), known func(any, any, P, map[string][]string, bool) ([]string, error), ) objectRegistration[P]
ObjectRegistration compares opaque manifests without SDK field selectors.
func OwnedFields ¶
func OwnedFields(obj *unstructured.Unstructured, manager string) (string, error)
Types ¶
type APIResourceRow ¶ added in v0.2.0
type APIResourcesDataSource ¶ added in v0.2.0
type APIResourcesDataSource struct {
// APIGroup is an exact filter. Empty selects core; omission selects all groups.
APIGroup *string
// Namespaced filters scope when provided, including an explicit false value.
Namespaced *bool
// Verbs requires every listed verb. An empty list selects all capabilities;
// duplicate verbs have the same meaning as one occurrence.
Verbs *[]string
// IncludeSubresources includes slash-separated names such as pods/status; defaults false.
IncludeSubresources *bool
// PreferredVersionsOnly defaults true; false returns all served versions separately.
PreferredVersionsOnly *bool
}
APIResourcesDataSource queries fresh API discovery with the configured identity. Results are sorted by group, version and resource name; list attributes are sorted and deduplicated. A successful query with no matches returns an empty list.
Any discovery failure rejects the whole query, including a partial failure in a group excluded by filters. Discovered verbs describe API capabilities and do not establish that the configured identity has permission to use them.
func (APIResourcesDataSource) Constraints ¶ added in v0.2.0
func (d APIResourcesDataSource) Constraints() []constraint.Constraint
func (APIResourcesDataSource) Defaults ¶ added in v0.2.0
func (d APIResourcesDataSource) Defaults() []defaults.Default
func (*APIResourcesDataSource) Read ¶ added in v0.2.0
func (d *APIResourcesDataSource) Read( ctx context.Context, c *config.Configuration, ) (*APIResourcesDataSourceOutput, error)
type APIResourcesDataSourceOutput ¶ added in v0.2.0
type APIResourcesDataSourceOutput struct {
Resources []APIResourceRow
}
type AnnotationsResource ¶
type AnnotationsResource struct {
APIVersion string
Kind string
Metadata ObjectLookupMetadata
Annotations *map[string]string
TemplateAnnotations *map[string]string
FieldManager *string
ForceConflicts *bool
}
func (AnnotationsResource) Constraints ¶
func (r AnnotationsResource) Constraints() []constraint.Constraint
func (*AnnotationsResource) Create ¶
func (r *AnnotationsResource) Create( ctx context.Context, c *config.Configuration, ) (*AnnotationsResourceOutput, error)
func (AnnotationsResource) Defaults ¶
func (r AnnotationsResource) Defaults() []defaults.Default
func (*AnnotationsResource) Delete ¶
func (r *AnnotationsResource) Delete( ctx context.Context, c *config.Configuration, p annotationsPrior, ) error
func (*AnnotationsResource) Read ¶
func (r *AnnotationsResource) Read( ctx context.Context, c *config.Configuration, p annotationsPrior, ) (*AnnotationsResourceOutput, error)
func (*AnnotationsResource) ResourceDefinition ¶
func (r *AnnotationsResource) ResourceDefinition() runtime.ResourceDefinition[ AnnotationsResource, *AnnotationsResourceOutput, *config.Configuration, ]
func (*AnnotationsResource) Update ¶
func (r *AnnotationsResource) Update( ctx context.Context, c *config.Configuration, p annotationsPrior, ) (*AnnotationsResourceOutput, error)
type Client ¶
type Client struct {
Resource dynamic.ResourceInterface
Server string
Namespace string
}
func Connect ¶
func Connect( c *config.Configuration, gvk schema.GroupVersionKind, namespace string, ) (*Client, error)
func TargetClient ¶
func TargetClient(c *config.Configuration, target Target) (*Client, error)
type EnvFieldRef ¶
type EnvResource ¶
type EnvResource struct {
APIVersion string
Kind string
Metadata ObjectLookupMetadata
Container *string
InitContainer *string
Env []EnvVar
FieldManager *string
ForceConflicts *bool
// contains filtered or unexported fields
}
func (EnvResource) Constraints ¶
func (r EnvResource) Constraints() []constraint.Constraint
func (*EnvResource) Create ¶
func (r *EnvResource) Create( ctx context.Context, c *config.Configuration, ) (*EnvResourceOutput, error)
func (EnvResource) Defaults ¶
func (r EnvResource) Defaults() []defaults.Default
func (*EnvResource) Delete ¶
func (*EnvResource) Delete(ctx context.Context, c *config.Configuration, p envPrior) error
func (*EnvResource) Read ¶
func (r *EnvResource) Read( ctx context.Context, c *config.Configuration, p envPrior, ) (*EnvResourceOutput, error)
func (*EnvResource) ResourceDefinition ¶
func (*EnvResource) ResourceDefinition() runtime.ResourceDefinition[ EnvResource, *EnvResourceOutput, *config.Configuration, ]
func (*EnvResource) Update ¶
func (r *EnvResource) Update( ctx context.Context, c *config.Configuration, p envPrior, ) (*EnvResourceOutput, error)
type EnvResourceFieldRef ¶
type EnvResourceOutput ¶
type EnvValueFrom ¶
type EnvValueFrom struct {
ConfigMapKeyRef *EnvKeyRef `json:"configMapKeyRef,omitempty"`
SecretKeyRef *EnvKeyRef `json:"secretKeyRef,omitempty"`
FieldRef *EnvFieldRef `json:"fieldRef,omitempty"`
ResourceFieldRef *EnvResourceFieldRef `json:"resourceFieldRef,omitempty"`
}
type EnvVar ¶
type EnvVar struct {
Name string `json:"name"`
Value *string `json:"value,omitempty"`
ValueFrom *EnvValueFrom `json:"valueFrom,omitempty"`
}
type LabelsResource ¶
type LabelsResource struct {
APIVersion string
Kind string
Metadata ObjectLookupMetadata
Labels map[string]string
FieldManager *string
ForceConflicts *bool
}
func (LabelsResource) Constraints ¶
func (r LabelsResource) Constraints() []constraint.Constraint
func (*LabelsResource) Create ¶
func (r *LabelsResource) Create( ctx context.Context, c *config.Configuration, ) (*LabelsResourceOutput, error)
func (LabelsResource) Defaults ¶
func (r LabelsResource) Defaults() []defaults.Default
func (*LabelsResource) Delete ¶
func (r *LabelsResource) Delete(ctx context.Context, c *config.Configuration, p labelsPrior) error
func (*LabelsResource) Read ¶
func (r *LabelsResource) Read( ctx context.Context, c *config.Configuration, p labelsPrior, ) (*LabelsResourceOutput, error)
func (*LabelsResource) ResourceDefinition ¶
func (r *LabelsResource) ResourceDefinition() runtime.ResourceDefinition[ LabelsResource, *LabelsResourceOutput, *config.Configuration, ]
func (*LabelsResource) Update ¶
func (r *LabelsResource) Update( ctx context.Context, c *config.Configuration, p labelsPrior, ) (*LabelsResourceOutput, error)
type LabelsResourceOutput ¶
type ObjectDataSource ¶
type ObjectDataSource struct {
APIVersion string
Kind string
Metadata ObjectLookupMetadata
}
func (ObjectDataSource) Constraints ¶
func (d ObjectDataSource) Constraints() []constraint.Constraint
func (*ObjectDataSource) Read ¶
func (d *ObjectDataSource) Read( ctx context.Context, c *config.Configuration, ) (*ObjectDataSourceOutput, error)
type ObjectDataSourceOutput ¶
type ObjectLookupMetadata ¶
type ObjectResource ¶
type ObjectResource struct {
// Manifest is one structured object with apiVersion, kind, and metadata.name.
// Nested fields use native Kubernetes names. JSON and YAML strings are rejected.
Manifest any `ub:",sensitive"`
FieldManager *string
ForceConflicts *bool
DeleteTimeout *string
// contains filtered or unexported fields
}
ObjectResource manages one structured Kubernetes object with server-side apply.
func (*ObjectResource) Create ¶
func (r *ObjectResource) Create( ctx context.Context, c *config.Configuration, ) (*ObjectResourceOutput, error)
func (*ObjectResource) Delete ¶
func (r *ObjectResource) Delete(ctx context.Context, c *config.Configuration, p prior) error
func (*ObjectResource) Read ¶
func (r *ObjectResource) Read( ctx context.Context, c *config.Configuration, p prior, ) (*ObjectResourceOutput, error)
func (*ObjectResource) ResourceDefinition ¶
func (r *ObjectResource) ResourceDefinition() runtime.ResourceDefinition[ ObjectResource, *ObjectResourceOutput, *config.Configuration, ]
func (*ObjectResource) Update ¶
func (r *ObjectResource) Update( ctx context.Context, c *config.Configuration, p prior, ) (*ObjectResourceOutput, error)
type ObjectResourceOutput ¶
type ObjectsDataSource ¶
type ObjectsDataSource struct {
APIVersion string
Kind string
Namespace *string
LabelSelector *string
FieldSelector *string
Limit *float64
// contains filtered or unexported fields
}
func (ObjectsDataSource) Constraints ¶
func (d ObjectsDataSource) Constraints() []constraint.Constraint
func (*ObjectsDataSource) Read ¶
func (d *ObjectsDataSource) Read( ctx context.Context, c *config.Configuration, ) (*ObjectsDataSourceOutput, error)
func (*ObjectsDataSource) UnmarshalMapstructure ¶
func (d *ObjectsDataSource) UnmarshalMapstructure(input any) error
type ObjectsDataSourceOutput ¶
type WaitAction ¶ added in v0.2.0
type WaitAction struct {
// APIVersion selects the exact served version, including the API group when present.
APIVersion string
Kind string
// Metadata selects the name and optional namespace. Namespaced lookups use
// the configured namespace when omitted.
Metadata ObjectLookupMetadata
// ExpectedUID constrains identity instead of adopting the first observed UID.
ExpectedUID *string
// Timeout bounds Kubernetes HTTP requests and polling; defaults to 5m.
Timeout *string
// Exists must be true when selected and waits for the object to appear.
Exists *bool
// Deleted must be true when selected and waits for absence.
Deleted *bool
// Condition matches status.conditions by case-sensitive type. Status defaults
// to True; explicit statuses are True, False or Unknown. Missing conditions stay
// pending. Reported observed generations must cover metadata.generation.
Condition *WaitCondition
// Field traverses a nonempty path of literal map keys; array indices and
// JSONPath are unsupported. Select one scalar equality or presence predicate.
// Null counts as absence; false, zero and empty strings count as present.
// Equality rejects incompatible types. Compared values are sensitive.
Field *WaitField `ub:",sensitive"`
}
WaitAction observes one named Kubernetes object without changing it. Select exactly one of exists, deleted, condition or field. A terminating object cannot satisfy a positive predicate. Replacement after the first observation fails the invocation. Initial absence satisfies deleted without proving that an expected UID previously existed.
Unchanged actions can skip; their outputs describe the last successful invocation. An explicit or always trigger requests another observation. Planning does not wait.
func (WaitAction) Constraints ¶ added in v0.2.0
func (a WaitAction) Constraints() []constraint.Constraint
func (WaitAction) Defaults ¶ added in v0.2.0
func (a WaitAction) Defaults() []defaults.Default
func (*WaitAction) Run ¶ added in v0.2.0
func (a *WaitAction) Run( ctx context.Context, c *config.Configuration, ) (*WaitActionOutput, error)
type WaitActionOutput ¶ added in v0.2.0
type WaitCondition ¶ added in v0.2.0
type WaitCondition struct {
Type string
// Status defaults to True; explicit values are True, False or Unknown.
Status *string
}
WaitCondition matches status.conditions case-sensitively. Missing conditions remain pending. Reported observed generations must cover metadata.generation; absence of generation reporting permits a matching condition.
type WaitField ¶ added in v0.2.0
type WaitField struct {
// Path is a nonempty list of literal map keys, including empty keys.
// Array indices, JSONPath expressions and wildcards are unsupported.
Path []string
// StringEquals permits an empty comparison string.
StringEquals *string
// BooleanEquals permits false as a comparison value.
BooleanEquals *bool
// IntegerEquals uses exact integer observations and JSON-safe desired integers.
IntegerEquals *int64
// Exists tests non-null presence. False matches missing or null values while
// the object exists; empty collections, empty strings, false and zero are present.
Exists *bool
}
WaitField selects exactly one scalar comparison or presence predicate. Equality remains pending for absent or null values and rejects incompatible types.