object

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 39 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUID

func CheckUID(target Target, observed metav1.Object) error

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 OwnedFields

func OwnedFields(obj *unstructured.Unstructured, manager string) (string, error)

Types

type APIResourceRow added in v0.2.0

type APIResourceRow struct {
	APIVersion   string
	Group        string
	Version      string
	Name         string
	SingularName string
	Kind         string
	Namespaced   bool
	Verbs        []string
	ShortNames   []string
	Categories   []string
}

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

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 (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) Update

func (r *AnnotationsResource) Update(
	ctx context.Context, c *config.Configuration, p annotationsPrior,
) (*AnnotationsResourceOutput, error)

type AnnotationsResourceOutput

type AnnotationsResourceOutput struct {
	Server              string
	APIVersion          string
	Kind                string
	Name                string
	Namespace           string
	UID                 string
	Annotations         map[string]string
	TemplateAnnotations map[string]string
}

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 EnvFieldRef struct {
	APIVersion *string `json:"apiVersion,omitempty"`
	FieldPath  *string `json:"fieldPath,omitempty"`
}

type EnvKeyRef

type EnvKeyRef struct {
	Key      *string `json:"key,omitempty"`
	Name     *string `json:"name,omitempty"`
	Optional *bool   `json:"optional,omitempty"`
}

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 (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) Update

func (r *EnvResource) Update(
	ctx context.Context, c *config.Configuration, p envPrior,
) (*EnvResourceOutput, error)

type EnvResourceFieldRef

type EnvResourceFieldRef struct {
	ContainerName *string `json:"containerName,omitempty"`
	Divisor       *string `json:"divisor,omitempty"`
	Resource      string  `json:"resource"`
}

type EnvResourceOutput

type EnvResourceOutput struct {
	Server     string
	APIVersion string
	Kind       string
	Name       string
	Namespace  string
	UID        string
	Env        []EnvVar
}

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 (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) Update

func (r *LabelsResource) Update(
	ctx context.Context, c *config.Configuration, p labelsPrior,
) (*LabelsResourceOutput, error)

type LabelsResourceOutput

type LabelsResourceOutput struct {
	Server     string
	APIVersion string
	Kind       string
	Name       string
	Namespace  string
	UID        string
	Labels     map[string]string
}

type Manifest added in v0.3.0

type Manifest struct {
	APIVersion string `ub:"apiVersion"`
	Kind       string
	Metadata   ManifestMetadata
	Extra      map[string]any `ub:",remain"`
}

Manifest preserves native Kubernetes names and arbitrary object fields.

func DecodeManifest added in v0.3.0

func DecodeManifest(value any) (Manifest, error)

type ManifestDataSource added in v0.3.0

type ManifestDataSource struct {
	Value any `ub:",sensitive"`
}

ManifestDataSource converts a decoded JSON or YAML object to a typed manifest. It does not connect to Kubernetes.

func (*ManifestDataSource) Read added in v0.3.0

type ManifestDataSourceOutput added in v0.3.0

type ManifestDataSourceOutput struct {
	Manifest Manifest `ub:",sensitive"`
}

type ManifestMetadata added in v0.3.0

type ManifestMetadata struct {
	Name      string
	Namespace *string
	Extra     map[string]any `ub:",remain"`
}

type ObjectDataSource

type ObjectDataSource struct {
	APIVersion string
	Kind       string
	Metadata   ObjectLookupMetadata
}

func (ObjectDataSource) Constraints

func (d ObjectDataSource) Constraints() []constraint.Constraint

func (*ObjectDataSource) Read

type ObjectDataSourceOutput

type ObjectDataSourceOutput struct {
	Object *Manifest `ub:",sensitive"`
}

type ObjectLookupMetadata

type ObjectLookupMetadata struct {
	Name      string
	Namespace *string
}

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       Manifest `ub:",sensitive"`
	FieldManager   *string
	ForceConflicts *bool
	DeleteTimeout  *string
}

ObjectResource manages one structured Kubernetes object with server-side apply.

func (*ObjectResource) Create

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) Update

func (r *ObjectResource) Update(
	ctx context.Context, c *config.Configuration, p prior,
) (*ObjectResourceOutput, error)

type ObjectResourceOutput

type ObjectResourceOutput struct {
	Server     string
	APIVersion string
	Kind       string
	Name       string
	Namespace  string
	UID        string
	Fields     string         `ub:",sensitive"`
	Values     map[string]any `ub:",sensitive"`
}

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 (*ObjectsDataSource) UnmarshalMapstructure

func (d *ObjectsDataSource) UnmarshalMapstructure(input any) error

type ObjectsDataSourceOutput

type ObjectsDataSourceOutput struct {
	Objects *[]Manifest `ub:",sensitive"`
}

type Target

type Target struct {
	Server     string
	APIVersion string
	Kind       string
	Name       string
	Namespace  string
	UID        string
}

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

type WaitActionOutput added in v0.2.0

type WaitActionOutput struct {
	Server          string
	APIVersion      string
	Kind            string
	Name            string
	Namespace       string
	Predicate       string
	UID             *string
	ResourceVersion *string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL