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 ¶
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 ¶
NewFromKubeConfig creates a new Engine from a kubeconfig file path, initializing the Kubernetes client and necessary configurations.
func NewFromRestConfig ¶
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) Read ¶
func (m *Engine) Read(ctx context.Context, obj *unstructured.Unstructured) (*ResourceStatusEntry, error)
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" )