operatorutil

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package operatorutil provides shared utilities for the MCP operator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCondition

func SetCondition(conditions *[]metav1.Condition, condType ConditionType, ready bool, reason, message string, generation int64)

SetCondition sets a condition in the conditions slice. It updates an existing condition if present, or appends a new one. LastTransitionTime is only updated when the condition's Status actually flips.

func UpdateMCPServerStatus

func UpdateMCPServerStatus(ctx context.Context, c client.Client, obj client.Object, phase, message string, readiness ResourceReadiness) error

UpdateMCPServerStatus updates the status of an MCPServer object with consistent condition handling. It fetches the latest object, updates the status fields and conditions, and applies the update.

Types

type ConditionType

type ConditionType string

ConditionType represents the type of status condition.

const (
	// DeploymentReady indicates the deployment is ready.
	DeploymentReady ConditionType = "DeploymentReady"
	// ServiceReady indicates the service is ready.
	ServiceReady ConditionType = "ServiceReady"
	// IngressReady indicates the ingress is ready.
	IngressReady ConditionType = "IngressReady"
	// GatewayReady indicates the gateway configuration and sidecar are ready.
	GatewayReady ConditionType = "GatewayReady"
	// PolicyReady indicates policy data for the gateway has been generated.
	PolicyReady ConditionType = "PolicyReady"
	// CanaryReady indicates the canary deployment, when configured, is ready.
	CanaryReady ConditionType = "CanaryReady"
)

type ResourceReadiness

type ResourceReadiness struct {
	Deployment bool
	Service    bool
	Ingress    bool
	Gateway    bool
	Policy     bool
	Canary     bool
}

ResourceReadiness tracks the readiness of different resource types.

Jump to

Keyboard shortcuts

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