controller

package
v0.0.0-...-7c042b9 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package controller implements the main Kubernetes controller for managing the OpenShift Lightspeed operator lifecycle.

This package contains the OLSConfigReconciler, which is the central orchestrator for the entire operator. It coordinates reconciliation across all components (appserver, postgres, console) and manages the OLSConfig custom resource.

Key Responsibilities:

  • Reconcile the OLSConfig custom resource
  • Coordinate component reconciliation (appserver, postgres, console)
  • Manage status conditions and CR status updates
  • Delegate LLM provider secret reconciliation to appserver package
  • Set up resource watchers for automatic updates (secrets, configmaps)
  • Implement hash-based change detection for configuration updates
  • Manage operator-level resources (service monitors, network policies)

The main reconciliation flow:

  1. Reconcile operator-level resources (service monitor, network policy)
  2. Delegate LLM provider secret reconciliation to appserver.ReconcileLLMSecrets()
  3. Reconcile PostgreSQL database (if conversation cache enabled)
  4. Reconcile Console UI plugin
  5. Reconcile application server components
  6. Update status conditions based on deployment readiness

The OLSConfigReconciler implements the reconciler.Reconciler interface, allowing it to be passed to component packages for isolated reconciliation without circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OLSConfigReconciler

type OLSConfigReconciler struct {
	client.Client
	Logger            logr.Logger
	StateCache        map[string]string
	Options           utils.OLSConfigReconcilerOptions
	NextReconcileTime time.Time
}

OLSConfigReconciler reconciles a OLSConfig object

func (*OLSConfigReconciler) GetAppServerImage

func (r *OLSConfigReconciler) GetAppServerImage() string

func (*OLSConfigReconciler) GetConsoleUIImage

func (r *OLSConfigReconciler) GetConsoleUIImage() string

func (*OLSConfigReconciler) GetDataverseExporterImage

func (r *OLSConfigReconciler) GetDataverseExporterImage() string

func (*OLSConfigReconciler) GetLCoreImage

func (r *OLSConfigReconciler) GetLCoreImage() string

func (*OLSConfigReconciler) GetLogger

func (r *OLSConfigReconciler) GetLogger() logr.Logger

func (*OLSConfigReconciler) GetNamespace

func (r *OLSConfigReconciler) GetNamespace() string

func (*OLSConfigReconciler) GetOpenShiftMCPServerImage

func (r *OLSConfigReconciler) GetOpenShiftMCPServerImage() string

func (*OLSConfigReconciler) GetOpenShiftMajor

func (r *OLSConfigReconciler) GetOpenShiftMajor() string

func (*OLSConfigReconciler) GetOpenshiftMinor

func (r *OLSConfigReconciler) GetOpenshiftMinor() string

func (*OLSConfigReconciler) GetPostgresImage

func (r *OLSConfigReconciler) GetPostgresImage() string

func (*OLSConfigReconciler) GetScheme

func (r *OLSConfigReconciler) GetScheme() *runtime.Scheme

Implement reconciler.Reconciler interface

func (*OLSConfigReconciler) GetStateCache

func (r *OLSConfigReconciler) GetStateCache() map[string]string

func (*OLSConfigReconciler) IsPrometheusAvailable

func (r *OLSConfigReconciler) IsPrometheusAvailable() bool

func (*OLSConfigReconciler) Reconcile

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

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.17.3/pkg/reconcile

func (*OLSConfigReconciler) ReconcileNetworkPolicyForOperator

func (r *OLSConfigReconciler) ReconcileNetworkPolicyForOperator(ctx context.Context) error

func (*OLSConfigReconciler) ReconcileServiceMonitorForOperator

func (r *OLSConfigReconciler) ReconcileServiceMonitorForOperator(ctx context.Context) error

func (*OLSConfigReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*OLSConfigReconciler) UpdateStatusCondition

func (r *OLSConfigReconciler) UpdateStatusCondition(ctx context.Context, olsconfig *olsv1alpha1.OLSConfig, conditionType string, status bool, message string, err error, inCluster ...bool)

updateStatusCondition updates the status condition of the OLSConfig Custom Resource instance. TODO: Should we support Unknown status and ObservedGeneration? TODO: conditionType must be metav1.Condition?

Directories

Path Synopsis
Package appserver provides reconciliation logic for the OpenShift Lightspeed application server component.
Package appserver provides reconciliation logic for the OpenShift Lightspeed application server component.
Package console provides reconciliation logic for the OpenShift Console UI plugin that integrates OpenShift Lightspeed into the OpenShift web console.
Package console provides reconciliation logic for the OpenShift Console UI plugin that integrates OpenShift Lightspeed into the OpenShift web console.
Package lcore provides reconciliation logic for the LightSpeed Core (LCore) component.
Package lcore provides reconciliation logic for the LightSpeed Core (LCore) component.
Package postgres provides reconciliation logic for the PostgreSQL database component used by OpenShift Lightspeed for conversation cache storage.
Package postgres provides reconciliation logic for the PostgreSQL database component used by OpenShift Lightspeed for conversation cache storage.
Package reconciler defines the interface contract between the main OLSConfigReconciler and component-specific reconcilers (appserver, postgres, console).
Package reconciler defines the interface contract between the main OLSConfigReconciler and component-specific reconcilers (appserver, postgres, console).
Package utils provides shared utility functions, types, and constants used across the OpenShift Lightspeed operator components.
Package utils provides shared utility functions, types, and constants used across the OpenShift Lightspeed operator components.

Jump to

Keyboard shortcuts

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