Documentation
¶
Index ¶
- Constants
- func StatusFailed(obj ServiceProviderAPI, msg string)
- func StatusProgressing(obj ServiceProviderAPI, reason string, message string)
- func StatusReady(obj ServiceProviderAPI)
- func StatusTerminating(obj ServiceProviderAPI)
- type ClusterContext
- type PCReconciler
- func (r *PCReconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *PCReconciler[T]) SetupWithManager(mgr ctrl.Manager) error
- func (r *PCReconciler[T]) WithPlatformCluster(c *clusters.Cluster) *PCReconciler[T]
- func (r *PCReconciler[T]) WithUpdateChannel(c chan event.GenericEvent) *PCReconciler[T]
- type ProviderConfig
- type SPReconciler
- func (r *SPReconciler[T, PC]) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *SPReconciler[T, PC]) SetupWithManager(mgr ctrl.Manager, name string, providerConfigUpdates chan event.GenericEvent) error
- func (r *SPReconciler[T, PC]) WithClusterAccessReconciler(car clusteraccess.Reconciler) *SPReconciler[T, PC]
- func (r *SPReconciler[T, PC]) WithOnboardingCluster(c *clusters.Cluster) *SPReconciler[T, PC]
- func (r *SPReconciler[T, PC]) WithPlatformCluster(c *clusters.Cluster) *SPReconciler[T, PC]
- func (r *SPReconciler[T, PC]) WithServiceProviderReconciler(dsr ServiceProviderReconciler[T, PC]) *SPReconciler[T, PC]
- func (r *SPReconciler[T, PC]) WithWorkloadCluster(b bool) *SPReconciler[T, PC]
- type ServiceProviderAPI
- type ServiceProviderAPIStatus
- type ServiceProviderReconciler
Constants ¶
const ( // ServiceProviderConditionReady is the condition type used when reporting status ServiceProviderConditionReady = "Ready" // StatusPhaseReady indicates that the resource is ready. All conditions are met and are in status "True". StatusPhaseReady = "Ready" // StatusPhaseProgressing indicates that the resource is not ready and being created or updated. StatusPhaseProgressing = "Progressing" // StatusPhaseTerminating indicates that the resource is not ready and in deletion. StatusPhaseTerminating = "Terminating" )
TODO: Move status fuctions and constants to separate repository
Variables ¶
This section is empty.
Functions ¶
func StatusFailed ¶
func StatusFailed(obj ServiceProviderAPI, msg string)
StatusFailed indicates ready with ready true
func StatusProgressing ¶
func StatusProgressing(obj ServiceProviderAPI, reason string, message string)
StatusProgressing indicates progressing with synced false
func StatusReady ¶
func StatusReady(obj ServiceProviderAPI)
StatusReady indicates ready with ready true
func StatusTerminating ¶
func StatusTerminating(obj ServiceProviderAPI)
StatusTerminating indicates terminating with synced false
Types ¶
type ClusterContext ¶
type ClusterContext struct {
// MCPCluster is the managed control plane that belongs to the current reconcile request
MCPCluster *clusters.Cluster
// WorkloadCluster is the workload cluster that belongs the current reconcile request
WorkloadCluster *clusters.Cluster
}
ClusterContext provides access to request-scoped clusters. These clusters include the managed control plane and workload clusters associated with a specific reconcile request. (Static clusters like the platform and onboarding clusters are provided to the reconciler when it is initialized.)
More info on the deployment model: https://openmcp-project.github.io/docs/about/design/service-provider#deployment-model
type PCReconciler ¶
type PCReconciler[T ProviderConfig] struct { // contains filtered or unexported fields }
PCReconciler notifies the service provider about provider config updates through a shared update channel. Any provider config change results in a reconcile request for every existing service provider api object.
func NewPCReconciler ¶
func NewPCReconciler[T ProviderConfig](providerName string, emptyObj func() T) *PCReconciler[T]
NewPCReconciler creates a new provider PCReconciler instance.
func (*PCReconciler[T]) Reconcile ¶
Reconcile acts as a sender to notify receivers about provider config changes .
func (*PCReconciler[T]) SetupWithManager ¶
func (r *PCReconciler[T]) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*PCReconciler[T]) WithPlatformCluster ¶
func (r *PCReconciler[T]) WithPlatformCluster(c *clusters.Cluster) *PCReconciler[T]
WithPlatformCluster sets the platform cluster.
func (*PCReconciler[T]) WithUpdateChannel ¶
func (r *PCReconciler[T]) WithUpdateChannel(c chan event.GenericEvent) *PCReconciler[T]
WithUpdateChannel sets the channel to send config changes.
type ProviderConfig ¶
type ProviderConfig interface {
client.Object
// PollIntveral can be used to periodically requeue, preventing managed objects
// from drifting on the target cluster. Return 0 if not required.
PollInterval() time.Duration
}
ProviderConfig represents the config for platform operators The ProviderConfig is passed to the DomainServiceReconcile to reconcile APIObjects
type SPReconciler ¶
type SPReconciler[T ServiceProviderAPI, PC ProviderConfig] struct { // contains filtered or unexported fields }
SPReconciler implements a generic reconcile loop to separate platform and service provider developer space.
func NewSPReconciler ¶
func NewSPReconciler[T ServiceProviderAPI, PC ProviderConfig](emptyObj func() T) *SPReconciler[T, PC]
NewSPReconciler creates a reconciler instance for the given types.
func (*SPReconciler[T, PC]) Reconcile ¶
Reconcile orchestrates platform and DomainServiceReconciler logic to reconcile APIObjects
func (*SPReconciler[T, PC]) SetupWithManager ¶
func (r *SPReconciler[T, PC]) SetupWithManager(mgr ctrl.Manager, name string, providerConfigUpdates chan event.GenericEvent) error
SetupWithManager sets up the controller with the Manager.
func (*SPReconciler[T, PC]) WithClusterAccessReconciler ¶
func (r *SPReconciler[T, PC]) WithClusterAccessReconciler(car clusteraccess.Reconciler) *SPReconciler[T, PC]
WithClusterAccessReconciler sets the cluster access reconciler.
func (*SPReconciler[T, PC]) WithOnboardingCluster ¶
func (r *SPReconciler[T, PC]) WithOnboardingCluster(c *clusters.Cluster) *SPReconciler[T, PC]
WithOnboardingCluster set the onboarding cluster.
func (*SPReconciler[T, PC]) WithPlatformCluster ¶
func (r *SPReconciler[T, PC]) WithPlatformCluster(c *clusters.Cluster) *SPReconciler[T, PC]
WithPlatformCluster set the platform cluster.
func (*SPReconciler[T, PC]) WithServiceProviderReconciler ¶
func (r *SPReconciler[T, PC]) WithServiceProviderReconciler(dsr ServiceProviderReconciler[T, PC]) *SPReconciler[T, PC]
WithServiceProviderReconciler sets the service provider reconciler.
func (*SPReconciler[T, PC]) WithWorkloadCluster ¶
func (r *SPReconciler[T, PC]) WithWorkloadCluster(b bool) *SPReconciler[T, PC]
WithWorkloadCluster sets if the service provider reconciler requests a workload cluster
type ServiceProviderAPI ¶
type ServiceProviderAPI interface {
client.Object
ServiceProviderAPIStatus
Finalizer() string
}
ServiceProviderAPI represents the end-user facing onboarding api type
type ServiceProviderAPIStatus ¶
type ServiceProviderAPIStatus interface {
// GetStatus returns the status object
GetStatus() any
// GetConditions returns the status object
GetConditions() *[]metav1.Condition
// SetPhase sets Status.Phase
SetPhase(string)
// SetObservedGeneration sets Status.ObservedGeneration
SetObservedGeneration(int64)
}
ServiceProviderAPIStatus represents the common status contract of ServiceProviderAPI types
type ServiceProviderReconciler ¶
type ServiceProviderReconciler[T ServiceProviderAPI, PC ProviderConfig] interface { // CreateOrUpdate is called on every add or update event CreateOrUpdate(ctx context.Context, obj T, pc PC, clusters ClusterContext) (ctrl.Result, error) // Delete is called on every delete event Delete(ctx context.Context, obj T, pc PC, clusters ClusterContext) (ctrl.Result, error) }
ServiceProviderReconciler implements any business logic required to manage ServiceProviderAPI objects