apply

package
v0.0.0-...-60784e1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package apply server-side-applies arbitrary unstructured Kubernetes objects from the CLI. Used by deploy to push the four platform CRs after the operator chart is installed.

Server-side apply is preferred over kubectl-style client-side apply: it converges multiple CLI runs cleanly, surfaces conflict errors with the field-owning manager, and matches how the operator itself writes back to .status (so co-ownership of .spec stays clean).

Index

Constants

View Source
const FieldManager = "educates-cli"

FieldManager is the SSA owner the CLI claims for fields it sets.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps dynamic.Interface + RESTMapper for server-side apply. One Client per `educates admin platform deploy` run.

func New

New builds a Client from a kubectl-style RESTClientGetter.

func (*Client) Apply

Apply server-side-applies one Unstructured. force=true so re-runs after the operator stamps defaults into .spec don't deadlock on field conflicts the operator caused.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, gvk schema.GroupVersionKind, namespace, name string) error

Delete removes one object by GVK + name. Idempotent: missing → nil.

func (*Client) Get

func (c *Client) Get(ctx context.Context, gvk schema.GroupVersionKind, namespace, name string) (*unstructured.Unstructured, error)

Get returns the live object for a GVK + name, or NotFound. Used by callers that need to poll a status field (e.g. CRD Established) without also pulling in the wait package.

func (*Client) InvalidateDiscovery

func (c *Client) InvalidateDiscovery()

InvalidateDiscovery clears the cached discovery snapshot and resets the deferred mapper. Call this after applying CRDs so the next RESTMapping lookup re-fetches `/apis` and picks up the newly registered kinds. Without it, the mapper's reset-on-NoMatchError retry path rebuilds from the same stale cache and the new GVK stays invisible.

Jump to

Keyboard shortcuts

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