controllers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddObjectsToInventory

func AddObjectsToInventory(inv *deliveryv1alpha1.ResourceInventory, set *ssa.ChangeSet) error

AddObjectsToInventory extracts the metadata from the given objects and adds it to the inventory.

func DiffInventory

DiffInventory returns the slice of objects that do not exist in the target inventory.

func ListMetaInInventory

func ListMetaInInventory(inv *deliveryv1alpha1.ResourceInventory) (object.ObjMetadataSet, error)

ListMetaInInventory returns the inventory entries as object.ObjMetadata objects.

func ListObjectsInInventory

func ListObjectsInInventory(inv *deliveryv1alpha1.ResourceInventory) ([]*unstructured.Unstructured, error)

ListObjectsInInventory returns the inventory entries as unstructured.Unstructured objects.

func MkdirTempAbs

func MkdirTempAbs(dir, pattern string) (string, error)

MkdirTempAbs creates a tmp dir and returns the absolute path to the dir. This is required since certain OSes like MacOS create temporary files in e.g. `/private/var`, to which `/var` is a symlink.

Types

type SourceRevisionChangePredicate

type SourceRevisionChangePredicate struct {
	predicate.Funcs
}

func (SourceRevisionChangePredicate) Update

type UnpackerImpersonation

type UnpackerImpersonation struct {
	client.Client
	// contains filtered or unexported fields
}

func NewUnpackerImpersonation

func NewUnpackerImpersonation(
	d deliveryv1alpha1.Unpacker,
	kubeClient client.Client,
	statusPoller *polling.StatusPoller,
	defaultServiceAccount string) *UnpackerImpersonation

func (*UnpackerImpersonation) CanFinalize

func (di *UnpackerImpersonation) CanFinalize(ctx context.Context) bool

CanFinalize asserts if the given Unpacker can be finalized using impersonation.

func (*UnpackerImpersonation) GetClient

GetClient creates a controller-runtime client for talding to a Kubernetes API server. If KubeConfig is set, will use the kubeconfig bytes from the Kubernetes secret. If ServiceAccountName is set, will use the cluster provided kubeconfig impersonating the SA. If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running in cluster and use the cluster provided kubeconfig.

func (*UnpackerImpersonation) GetServiceAccountToken

func (di *UnpackerImpersonation) GetServiceAccountToken(ctx context.Context) (string, error)

type UnpackerReconciler

type UnpackerReconciler struct {
	client.Client
	Scheme                *runtime.Scheme
	StatusPoller          *polling.StatusPoller
	DefaultServiceAccount string
	OCIRegistryAddr       string
	OCMClient             ocmcontroller.FetchVerifier
	// contains filtered or unexported fields
}

UnpackerReconciler reconciles an Unpacker object

func (*UnpackerReconciler) Reconcile

func (r *UnpackerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop

func (*UnpackerReconciler) SetupWithManager

func (r *UnpackerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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