controller

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationChecksumFiles     = "rig.dev/config-checksum-files"
	AnnotationChecksumAutoEnv   = "rig.dev/config-checksum-auto-env"
	AnnotationChecksumEnv       = "rig.dev/config-checksum-env"
	AnnotationChecksumSharedEnv = "rig.dev/config-checksum-shared-env"

	LabelSharedConfig = "rig.dev/shared-config"
	LabelCapsule      = "rig.dev/capsule"
	LabelCron         = "batch.kubernets.io/cronjob"
)
View Source
const (
	LabelOwnedByCapsule = "rig.dev/owned-by-capsule"
)

Variables

This section is empty.

Functions

func Get added in v1.6.4

func Get[T interface {
	client.Object
	comparable
}](req Request, key ObjectKey,
) T

func GetCurrent added in v1.6.4

func GetCurrent[T client.Object](req Request, key ObjectKey) T

func GetNew added in v1.6.4

func GetNew[T client.Object](req Request, key ObjectKey) T

func IsOwnedBy

func IsOwnedBy(owner metav1.Object, obj metav1.Object) bool

func ObjectsEquals added in v1.6.4

func ObjectsEquals(o1, o2 client.Object) bool

Types

type CapsuleReconciler

type CapsuleReconciler struct {
	client.Client
	Scheme              *runtime.Scheme
	Config              *configv1alpha1.OperatorConfig
	ClientSet           clientset.Interface
	CapabilitiesService capabilities.Service
}

CapsuleReconciler reconciles a Capsule object

func (*CapsuleReconciler) Reconcile

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

Reconcile compares the state specified by the Capsule object against the actual cluster state, and then performs operations to make the cluster state reflect the state specified by the Capsule.

func (*CapsuleReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type CronJobStep added in v1.6.4

type CronJobStep struct{}

func NewCronJobStep added in v1.6.4

func NewCronJobStep() *CronJobStep

func (*CronJobStep) Apply added in v1.6.4

func (s *CronJobStep) Apply(_ context.Context, req Request) error

type DeploymentStep added in v1.6.4

type DeploymentStep struct{}

func NewDeploymentStep added in v1.6.4

func NewDeploymentStep() *DeploymentStep

func (*DeploymentStep) Apply added in v1.6.4

func (s *DeploymentStep) Apply(ctx context.Context, req Request) error

type NetworkStep added in v1.6.4

type NetworkStep struct{}

func NewNetworkStep added in v1.6.4

func NewNetworkStep() *NetworkStep

func (*NetworkStep) Apply added in v1.6.4

func (s *NetworkStep) Apply(_ context.Context, req Request) error

type Object added in v1.6.4

type Object struct {
	Current client.Object
	New     client.Object
}

type ObjectKey added in v1.6.4

type ObjectKey struct {
	client.ObjectKey
	schema.GroupVersionKind
}

func (ObjectKey) MarshalLog added in v1.6.4

func (ok ObjectKey) MarshalLog() interface{}

func (ObjectKey) String added in v1.6.4

func (ok ObjectKey) String() string

type ObjectsEqual added in v1.6.4

type ObjectsEqual func(o1, o2 client.Object) bool

type Pipeline added in v1.6.4

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

func NewPipeline added in v1.6.4

func NewPipeline(
	cc client.Client,
	config *configv1alpha1.OperatorConfig,
	capsule *v1alpha2.Capsule,
	scheme *runtime.Scheme,
	logger logr.Logger,
) *Pipeline

func (*Pipeline) AddStep added in v1.6.4

func (p *Pipeline) AddStep(step Step)

func (*Pipeline) Capsule added in v1.6.4

func (p *Pipeline) Capsule() *v1alpha2.Capsule

func (*Pipeline) Client added in v1.6.4

func (p *Pipeline) Client() client.Client

func (*Pipeline) Config added in v1.6.4

func (p *Pipeline) Config() *configv1alpha1.OperatorConfig

func (*Pipeline) GetCurrent added in v1.6.4

func (p *Pipeline) GetCurrent(key ObjectKey) client.Object

func (*Pipeline) GetNew added in v1.6.4

func (p *Pipeline) GetNew(key ObjectKey) client.Object

func (*Pipeline) MarkUsedResource added in v1.6.4

func (p *Pipeline) MarkUsedResource(res v1alpha2.UsedResource)

func (*Pipeline) NamedObjectKey added in v1.6.4

func (p *Pipeline) NamedObjectKey(name string, gvk schema.GroupVersionKind) ObjectKey

func (*Pipeline) ObjectKey added in v1.6.4

func (p *Pipeline) ObjectKey(gvk schema.GroupVersionKind) ObjectKey

func (*Pipeline) Run added in v1.6.4

func (p *Pipeline) Run(ctx context.Context) error

func (*Pipeline) Scheme added in v1.6.4

func (p *Pipeline) Scheme() *runtime.Scheme

func (*Pipeline) Set added in v1.6.4

func (p *Pipeline) Set(key ObjectKey, obj client.Object)

type Request added in v1.6.4

type Request interface {
	Config() *configv1alpha1.OperatorConfig
	Scheme() *runtime.Scheme
	Client() client.Client
	Capsule() *v1alpha2.Capsule
	GetCurrent(key ObjectKey) client.Object
	GetNew(key ObjectKey) client.Object
	Set(key ObjectKey, obj client.Object)
	NamedObjectKey(name string, gvk schema.GroupVersionKind) ObjectKey
	ObjectKey(gvk schema.GroupVersionKind) ObjectKey
	MarkUsedResource(res v1alpha2.UsedResource)
}

type ServiceAccountStep added in v1.6.4

type ServiceAccountStep struct{}

func NewServiceAccountStep added in v1.6.4

func NewServiceAccountStep() *ServiceAccountStep

func (*ServiceAccountStep) Apply added in v1.6.4

func (s *ServiceAccountStep) Apply(_ context.Context, req Request) error

type ServiceMonitorStep added in v1.6.4

type ServiceMonitorStep struct{}

func NewServiceMonitorStep added in v1.6.4

func NewServiceMonitorStep() *ServiceMonitorStep

func (*ServiceMonitorStep) Apply added in v1.6.4

func (s *ServiceMonitorStep) Apply(_ context.Context, req Request) error

type Step added in v1.6.4

type Step interface {
	Apply(ctx context.Context, req Request) error
}

type VPAStep added in v1.6.4

type VPAStep struct{}

func NewVPAStep added in v1.6.4

func NewVPAStep() *VPAStep

func (*VPAStep) Apply added in v1.6.4

func (s *VPAStep) Apply(_ context.Context, req Request) error

Jump to

Keyboard shortcuts

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