mcpregistrystatus

package
v0.6.7 Latest Latest
Warning

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

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

Documentation

Overview

Package mcpregistrystatus provides status management and batched updates for MCPRegistry resources.

Package mcpregistrystatus provides status management for MCPRegistry resources.

Package mcpregistrystatus provides status management for MCPRegistry resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIStatusCollector added in v0.3.7

type APIStatusCollector interface {
	// Status returns the API status
	Status() *mcpv1alpha1.APIStatus

	// SetAPIStatus sets the detailed API status
	SetAPIStatus(phase mcpv1alpha1.APIPhase, message string, endpoint string)

	// SetAPIReadyCondition sets the API ready condition with the specified reason, message, and status
	SetAPIReadyCondition(reason, message string, status metav1.ConditionStatus)
}

APIStatusCollector handles API-related status updates

type DefaultStatusDeriver added in v0.3.7

type DefaultStatusDeriver struct{}

DefaultStatusDeriver implements the StatusDeriver interface

func (*DefaultStatusDeriver) DeriveOverallStatus added in v0.3.7

func (*DefaultStatusDeriver) DeriveOverallStatus(
	apiStatus *mcpv1alpha1.APIStatus) (mcpv1alpha1.MCPRegistryPhase, string)

DeriveOverallStatus derives the overall MCPRegistry phase and message from component statuses

type Error added in v0.3.7

type Error struct {
	Err             error
	Message         string
	ConditionType   string
	ConditionReason string
}

Error represents a structured error with condition information for operator components

func (*Error) Error added in v0.3.7

func (e *Error) Error() string

func (*Error) Unwrap added in v0.3.7

func (e *Error) Unwrap() error

type StatusCollector

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

StatusCollector collects status changes during reconciliation and applies them in a single batch update at the end. It implements the StatusManager interface.

func (*StatusCollector) API added in v0.3.7

API returns the API status collector

func (*StatusCollector) SetAPIReadyCondition

func (s *StatusCollector) SetAPIReadyCondition(reason, message string, status metav1.ConditionStatus)

SetAPIReadyCondition adds or updates the API ready condition.

func (*StatusCollector) SetAPIStatus

func (s *StatusCollector) SetAPIStatus(phase mcpv1alpha1.APIPhase, message string, endpoint string)

SetAPIStatus sets the detailed API status.

func (*StatusCollector) SetCondition added in v0.3.7

func (s *StatusCollector) SetCondition(conditionType, reason, message string, status metav1.ConditionStatus)

SetCondition sets a general condition with the specified type, reason, message, and status

func (*StatusCollector) SetMessage

func (s *StatusCollector) SetMessage(message string)

SetMessage sets the message to be updated.

func (*StatusCollector) SetOverallStatus added in v0.3.7

func (s *StatusCollector) SetOverallStatus(phase mcpv1alpha1.MCPRegistryPhase, message string)

SetOverallStatus sets the overall phase and message explicitly (for special cases)

func (*StatusCollector) SetPhase

func (s *StatusCollector) SetPhase(phase mcpv1alpha1.MCPRegistryPhase)

SetPhase sets the phase to be updated.

func (*StatusCollector) UpdateStatus added in v0.3.8

func (s *StatusCollector) UpdateStatus(ctx context.Context, mcpRegistryStatus *mcpv1alpha1.MCPRegistryStatus) bool

UpdateStatus applies all collected status changes in a single batch update. Requires the MCPRegistryStatus being the updated version from the cluster

type StatusDeriver added in v0.3.7

type StatusDeriver interface {
	// DeriveOverallStatus derives the overall MCPRegistry phase and message from component statuses
	DeriveOverallStatus(apiStatus *mcpv1alpha1.APIStatus) (mcpv1alpha1.MCPRegistryPhase, string)
}

StatusDeriver handles overall status derivation logic

func NewDefaultStatusDeriver added in v0.3.7

func NewDefaultStatusDeriver() StatusDeriver

NewDefaultStatusDeriver creates a new DefaultStatusDeriver

type StatusManager added in v0.3.7

type StatusManager interface {
	// API returns the API status collector
	API() APIStatusCollector

	// SetOverallStatus sets the overall phase and message explicitly (for special cases)
	SetOverallStatus(phase mcpv1alpha1.MCPRegistryPhase, message string)

	// SetCondition sets a general condition
	SetCondition(conditionType, reason, message string, status metav1.ConditionStatus)

	// UpdateStatus updates the status of the MCPRegistry if any change happened
	UpdateStatus(ctx context.Context, mcpRegistryStatus *mcpv1alpha1.MCPRegistryStatus) bool
}

StatusManager orchestrates all status updates and provides access to domain-specific collectors

func NewStatusManager added in v0.3.7

func NewStatusManager(mcpRegistry *mcpv1alpha1.MCPRegistry) StatusManager

NewStatusManager creates a new StatusManager for the given MCPRegistry resource.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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