engine

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	DryRun bool
}

ApplyOptions contains options for applying Kubernetes objects.

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine reconciles Kubernetes resources onto the target cluster using server-side apply.

func NewDefaultEngine

func NewDefaultEngine() (*Engine, error)

NewDefaultEngine creates a new Engine with default configuration using the specified config flags.

func NewFromClientGetter

func NewFromClientGetter(getter genericclioptions.RESTClientGetter) (*Engine, error)

NewFromClientGetter creates a new Engine from a REST client getter, initializing the Kubernetes client and necessary configurations.

func NewFromKubeConfig

func NewFromKubeConfig(kubeConfigPath string) (*Engine, error)

NewFromKubeConfig creates a new Engine from a kubeconfig file path, initializing the Kubernetes client and necessary configurations.

func NewFromRestConfig

func NewFromRestConfig(cfg *rest.Config) (*Engine, error)

NewFromRestConfig creates a new Engine from a rest.Config, initializing the Kubernetes client and necessary configurations.

func (*Engine) ApplyAll

func (m *Engine) ApplyAll(ctx context.Context, objects []*unstructured.Unstructured, opts *ApplyOptions) (*ResourceStatus, error)

Apply applies a set of Kubernetes objects using the specified options, and returns the resource status after the apply operation.

func (*Engine) Client

func (m *Engine) Client() dynamic.Interface

Client returns the Kubernetes client used by the engine.

func (*Engine) Read

Read kubernetes Resource by client-go

type ResourceStatus

type ResourceStatus struct {
	Entries []ResourceStatusEntry
}

ResourceStatus represents the status of a Kubernetes resource.

type ResourceStatusEntry

type ResourceStatusEntry struct {
	Object *unstructured.Unstructured
	// ObjMetadata holds the unique identifier of this entry.
	ObjMetadata kube.ObjMetadata
	// GroupVersion holds the API group version of this entry.
	GroupVersion string
	// Subject represents the Object ID in the format 'kind/namespace/name'.
	Subject string
	// Status represents the Status type taken by the reconciler for this object.
	Status Status
}

ResourceStatusEntry holds the status information for a resource.

func EntryFromUnstructuredWithStatus

func EntryFromUnstructuredWithStatus(o *unstructured.Unstructured, status Status) ResourceStatusEntry

EntryFromUnstructuredWithStatus creates a ResourceStatusEntry from an unstructured object along with the specified status.

type Status

type Status string

Status is a type representing the status of a resource.

const (
	// CreatedStatus represents the creation of a new object.
	CreatedStatus Status = "created"
	// ConfiguredStatus represents the update of an existing object.
	ConfiguredStatus Status = "configured"
	// UnchangedStatus represents the absence of any Status to an object.
	UnchangedStatus Status = "unchanged"
	// DeletedStatus represents the deletion of an object.
	DeletedStatus Status = "deleted"
	// SkippedStatus represents the fact that no Status was performed on an object
	// due to the object being excluded from the reconciliation.
	SkippedStatus Status = "skipped"
	// ExistedStatus represents a resource is existed in the cluster.
	ExistedStatus Status = "existed"
	// UnknownStatus represents an unknown Status.
	UnknownStatus Status = "unknown"
)

Jump to

Keyboard shortcuts

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