Documentation
¶
Index ¶
- type Client
- func (k *Client) Close() error
- func (k *Client) CreateEvent(ctx context.Context, obj client.Object, reason, message, eventType string) error
- func (k *Client) CreateEventForCRD(ctx context.Context, ...) error
- func (k *Client) CreateMCPServer(ctx context.Context, server *musterv1alpha1.MCPServer) error
- func (k *Client) CreateWorkflow(ctx context.Context, w *musterv1alpha1.Workflow) error
- func (k *Client) DeleteMCPServer(ctx context.Context, name, namespace string) error
- func (k *Client) DeleteWorkflow(ctx context.Context, name, namespace string) error
- func (k *Client) GetMCPServer(ctx context.Context, name, namespace string) (*musterv1alpha1.MCPServer, error)
- func (k *Client) GetWorkflow(ctx context.Context, name, namespace string) (*musterv1alpha1.Workflow, error)
- func (k *Client) IsKubernetesMode() bool
- func (k *Client) ListMCPServers(ctx context.Context, namespace string) ([]musterv1alpha1.MCPServer, error)
- func (k *Client) ListWorkflows(ctx context.Context, namespace string) ([]musterv1alpha1.Workflow, error)
- func (k *Client) QueryEvents(ctx context.Context, options api.EventQueryOptions) (*api.EventQueryResult, error)
- func (k *Client) Scheme() *runtime.Scheme
- func (k *Client) UpdateMCPServer(ctx context.Context, server *musterv1alpha1.MCPServer) error
- func (k *Client) UpdateMCPServerStatus(ctx context.Context, server *musterv1alpha1.MCPServer) error
- func (k *Client) UpdateWorkflow(ctx context.Context, w *musterv1alpha1.Workflow) error
- func (k *Client) UpdateWorkflowStatus(ctx context.Context, w *musterv1alpha1.Workflow) error
- func (k *Client) WatchEvents(ctx context.Context, options api.EventQueryOptions) (<-chan api.EventResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a Kubernetes-API-backed implementation of the muster client interface. Per-domain CRUD methods live in sibling files (mcpserver.go, workflow.go, events.go); this file keeps the type, constructor, scheme, lifecycle methods, and discovery-based CRD validation.
func New ¶
New returns a Kubernetes-backed Client for the given REST config. CRD presence is validated at construction so callers fail fast if the cluster hasn't installed muster's CRDs yet.
func (*Client) Close ¶
Close performs cleanup for the Kubernetes client. The controller-runtime client itself needs no cleanup, but the event broadcaster owns a background goroutine and watch that must be stopped.
func (*Client) CreateEvent ¶
func (k *Client) CreateEvent(ctx context.Context, obj client.Object, reason, message, eventType string) error
CreateEvent creates a Kubernetes Event for the given object via the EventBroadcaster, which aggregates duplicate events (Count) and rate-limits per source/object instead of writing one Event object per call.
func (*Client) CreateEventForCRD ¶
func (k *Client) CreateEventForCRD(ctx context.Context, crdType, name, namespace, reason, message, eventType string) error
CreateEventForCRD creates a Kubernetes Event for a CRD by type, name, and namespace. It best-effort loads the live object so the Event references the real UID, falling back to a minimal typed object carrying name/namespace.
func (*Client) CreateMCPServer ¶
func (*Client) CreateWorkflow ¶
func (*Client) DeleteMCPServer ¶
func (*Client) DeleteWorkflow ¶
func (*Client) GetMCPServer ¶
func (*Client) GetWorkflow ¶
func (*Client) IsKubernetesMode ¶
IsKubernetesMode returns true since this is the Kubernetes implementation.
func (*Client) ListMCPServers ¶
func (*Client) ListWorkflows ¶
func (*Client) QueryEvents ¶
func (k *Client) QueryEvents(ctx context.Context, options api.EventQueryOptions) (*api.EventQueryResult, error)
QueryEvents retrieves events from the Kubernetes Events API with filtering. Time-range and source-component filtering happen client-side because the Kubernetes field-selector API doesn't support those.
func (*Client) UpdateMCPServer ¶
func (*Client) UpdateMCPServerStatus ¶
func (*Client) UpdateWorkflow ¶
func (*Client) UpdateWorkflowStatus ¶
func (*Client) WatchEvents ¶ added in v0.14.1
func (k *Client) WatchEvents(ctx context.Context, options api.EventQueryOptions) (<-chan api.EventResult, error)
WatchEvents streams muster-sourced Kubernetes events matching the options as they occur, via a native watch on the Events API. The returned channel is closed when ctx is cancelled. The watch is re-established automatically if the API server closes it, advancing the resourceVersion to avoid replaying events already delivered.