resource

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 2

README

pkg/provisioners/resource

Intention

pkg/provisioners/resource is a legacy adapter that wraps a single Kubernetes client.Object in the provisioner interface. It is not a recommended abstraction for new provisioner code.

This package exists mostly as historical convenience for trivial single-object cases, likely things such as namespaces, where someone wanted to fit a plain Kubernetes object into the provisioner lifecycle without writing a purpose-built provisioner.

Invariants And Guard Rails

  • New provisioner code should avoid this package. It is legacy compatibility, not the preferred model for resource management.
  • Provision() simply applies controllerutil.CreateOrUpdate() to the provided object using the scoped client from provisioner context.
  • Deprovision() simply issues a delete for the provided object, treats not-found as success, and otherwise returns provisioners.ErrYield so the broader reconcile loop can come back while deletion completes.
  • The object must already be fully prepared by the caller. This package does not generate, enrich, or orchestrate resource state beyond the raw create-or-update/delete operations.

Caveats

  • The type and constructor comments are stale and misleading. The implementation does not parse YAML manifests and does not invoke kubectl.
  • This package adds almost no real abstraction beyond adapting a single client.Object to the provisioner interface.
  • It is only suitable for extremely trivial single-object cases. Anything with meaningful generation logic, multiple resources, lifecycle coordination, or nontrivial semantics should have a purpose-built provisioner instead.
  • This is a deletion candidate once the remaining namespace lifecycle call sites, currently in the identity organization and project provisioners, are rewritten as explicit namespace create/delete handling rather than funneled through this adapter.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

type Provisioner struct {
	provisioners.Metadata
	// contains filtered or unexported fields
}

Provisioner is a provisioner that is able to parse and manage resources sourced from a yaml manifest.

func New

func New(resource client.Object) *Provisioner

New returns a new provisioner that is capable of applying a manifest with kubectl. The path argument may be a path on the local file system or a URL.

func (*Provisioner) Deprovision

func (p *Provisioner) Deprovision(ctx context.Context) error

Deprovision implements the Provision interface.

func (*Provisioner) Provision

func (p *Provisioner) Provision(ctx context.Context) error

Provision implements the Provision interface.

Jump to

Keyboard shortcuts

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