applier

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateNeedsInstall string = "NeedsInstall"
	StateNeedsUpgrade string = "NeedsUpgrade"
	StateUnchanged    string = "Unchanged"
	StateError        string = "Error"
)
View Source
const (
	ClusterObjectSetRetentionLimit = 5
)

Variables

This section is empty.

Functions

func PhaseSort added in v1.6.0

PhaseSort takes an unsorted list of objects and organizes them into sorted phases. Each phase will be applied in order according to DefaultPhaseOrder. Objects within a single phase are applied simultaneously.

Types

type Boxcutter added in v1.6.0

type Boxcutter struct {
	Client            client.Client
	Scheme            *runtime.Scheme
	RevisionGenerator ClusterObjectSetGenerator
	Preflights        []Preflight
	PreAuthorizer     authorization.PreAuthorizer
	FieldOwner        string
	SystemNamespace   string
}

func (*Boxcutter) Apply added in v1.6.0

func (bc *Boxcutter) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (bool, string, error)

type BoxcutterStorageMigrator added in v1.6.0

type BoxcutterStorageMigrator struct {
	ActionClientGetter helmclient.ActionClientGetter
	RevisionGenerator  ClusterObjectSetGenerator
	Client             boxcutterStorageMigratorClient
	Scheme             *runtime.Scheme
	FieldOwner         string
}

BoxcutterStorageMigrator migrates ClusterExtensions from Helm-based storage to ClusterObjectSet storage, enabling upgrades from older operator-controller versions.

func (*BoxcutterStorageMigrator) Migrate added in v1.6.0

func (m *BoxcutterStorageMigrator) Migrate(ctx context.Context, ext *ocv1.ClusterExtension, objectLabels map[string]string) error

Migrate creates a ClusterObjectSet from an existing Helm release if no revisions exist yet. The migration is idempotent and skipped if revisions already exist or no Helm release is found.

type ClusterObjectSetGenerator added in v1.9.0

type ClusterObjectSetGenerator interface {
	GenerateRevision(ctx context.Context, bundleFS fs.FS, ext *ocv1.ClusterExtension, objectLabels, revisionAnnotations map[string]string) (*ocv1ac.ClusterObjectSetApplyConfiguration, error)
	GenerateRevisionFromHelmRelease(
		ctx context.Context,
		helmRelease *release.Release, ext *ocv1.ClusterExtension,
		objectLabels map[string]string,
	) (*ocv1ac.ClusterObjectSetApplyConfiguration, error)
}

type Helm

type Helm struct {
	ActionClientGetter            helmclient.ActionClientGetter
	Preflights                    []Preflight
	PreAuthorizer                 authorization.PreAuthorizer
	HelmChartProvider             HelmChartProvider
	HelmReleaseToObjectsConverter HelmReleaseToObjectsConverterInterface

	Manager contentmanager.Manager
	Watcher cache.Watcher
}

func (*Helm) Apply

func (h *Helm) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1.ClusterExtension, objectLabels map[string]string, storageLabels map[string]string) (bool, string, error)

type HelmChartProvider added in v1.6.0

type HelmChartProvider interface {
	Get(bundle fs.FS, clusterExtension *ocv1.ClusterExtension) (*chart.Chart, error)
}

HelmChartProvider provides helm charts from bundle sources and cluster extensions

type HelmReleaseToObjectsConverter added in v1.6.0

type HelmReleaseToObjectsConverter struct {
}

func (HelmReleaseToObjectsConverter) GetObjectsFromRelease added in v1.6.0

func (h HelmReleaseToObjectsConverter) GetObjectsFromRelease(rel *release.Release) ([]client.Object, error)

type HelmReleaseToObjectsConverterInterface added in v1.6.0

type HelmReleaseToObjectsConverterInterface interface {
	GetObjectsFromRelease(rel *release.Release) ([]client.Object, error)
}

type ManifestProvider added in v1.6.0

type ManifestProvider interface {
	// Get returns a set of resource manifests in bundle that take into account the configuration in ext
	Get(bundle fs.FS, ext *ocv1.ClusterExtension) ([]client.Object, error)
}

ManifestProvider returns the manifests that should be applied by OLM given a bundle and its associated ClusterExtension

type PackResult added in v1.9.0

type PackResult struct {
	// Secrets to be created before the COS.
	Secrets []corev1.Secret
	// Refs maps (phaseIndex, objectIndex) to the ObjectSourceRef
	// that should replace the inline object in the COS.
	Refs map[[2]int]ocv1.ObjectSourceRef
}

PackResult holds the packed Secrets and the ref entries that should replace inline objects in the COS phases.

type Phase added in v1.6.0

type Phase string

Phase represents a well-known phase.

const (
	PhaseNamespaces     Phase = "namespaces"
	PhasePolicies       Phase = "policies"
	PhaseIdentity       Phase = "identity"
	PhaseConfiguration  Phase = "configuration"
	PhaseStorage        Phase = "storage"
	PhaseCRDs           Phase = "crds"
	PhaseRoles          Phase = "roles"
	PhaseBindings       Phase = "bindings"
	PhaseInfrastructure Phase = "infrastructure"
	PhaseDeploy         Phase = "deploy"
	PhaseScaling        Phase = "scaling"
	PhasePublish        Phase = "publish"
	PhaseAdmission      Phase = "admission"
)

type Preflight

type Preflight interface {
	// Install runs checks that should be successful prior
	// to installing the Helm release. It is provided
	// a Helm release and returns an error if the
	// check is unsuccessful
	Install(context.Context, []client.Object) error

	// Upgrade runs checks that should be successful prior
	// to upgrading the Helm release. It is provided
	// a Helm release and returns an error if the
	// check is unsuccessful
	Upgrade(context.Context, []client.Object) error
}

Preflight is a check that should be run before making any changes to the cluster

type RegistryV1HelmChartProvider added in v1.6.0

type RegistryV1HelmChartProvider struct {
	ManifestProvider ManifestProvider
}

RegistryV1HelmChartProvider creates a Helm-Chart from a registry+v1 bundle and its associated ClusterExtension

func (*RegistryV1HelmChartProvider) Get added in v1.6.0

type RegistryV1ManifestProvider added in v1.6.0

type RegistryV1ManifestProvider struct {
	BundleRenderer              render.BundleRenderer
	CertificateProvider         render.CertificateProvider
	IsWebhookSupportEnabled     bool
	IsSingleOwnNamespaceEnabled bool
	IsDeploymentConfigEnabled   bool
}

RegistryV1ManifestProvider generates the manifests that should be installed for a registry+v1 bundle given the user specified configuration given by the ClusterExtension API surface

func (*RegistryV1ManifestProvider) Get added in v1.6.0

type SecretPacker added in v1.9.0

type SecretPacker struct {
	RevisionName    string
	OwnerName       string
	SystemNamespace string
}

SecretPacker packs serialized objects from COS phases into one or more immutable Secrets.

func (*SecretPacker) Pack added in v1.9.0

func (p *SecretPacker) Pack(phases []ocv1.ClusterObjectSetPhase) (*PackResult, error)

Pack takes COS phases with inline objects and produces:

  1. A set of immutable Secrets containing the serialized objects
  2. A mapping from (phaseIdx, objIdx) to the corresponding ObjectSourceRef

type SimpleRevisionGenerator added in v1.6.0

type SimpleRevisionGenerator struct {
	Scheme           *runtime.Scheme
	ManifestProvider ManifestProvider
}

func (*SimpleRevisionGenerator) GenerateRevision added in v1.6.0

func (r *SimpleRevisionGenerator) GenerateRevision(
	ctx context.Context,
	bundleFS fs.FS, ext *ocv1.ClusterExtension,
	objectLabels, revisionAnnotations map[string]string,
) (*ocv1ac.ClusterObjectSetApplyConfiguration, error)

func (*SimpleRevisionGenerator) GenerateRevisionFromHelmRelease added in v1.6.0

func (r *SimpleRevisionGenerator) GenerateRevisionFromHelmRelease(
	ctx context.Context,
	helmRelease *release.Release, ext *ocv1.ClusterExtension,
	objectLabels map[string]string,
) (*ocv1ac.ClusterObjectSetApplyConfiguration, error)

Jump to

Keyboard shortcuts

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