kubernetes

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Client
	// contains filtered or unexported fields
}

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

func New(config *rest.Config) (*Client, error)

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

func (k *Client) Close() error

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 (k *Client) CreateMCPServer(ctx context.Context, server *musterv1alpha1.MCPServer) error

func (*Client) CreateWorkflow

func (k *Client) CreateWorkflow(ctx context.Context, w *musterv1alpha1.Workflow) error

func (*Client) DeleteMCPServer

func (k *Client) DeleteMCPServer(ctx context.Context, name, namespace string) error

func (*Client) DeleteWorkflow

func (k *Client) DeleteWorkflow(ctx context.Context, name, namespace string) error

func (*Client) GetMCPServer

func (k *Client) GetMCPServer(ctx context.Context, name, namespace string) (*musterv1alpha1.MCPServer, error)

func (*Client) GetWorkflow

func (k *Client) GetWorkflow(ctx context.Context, name, namespace string) (*musterv1alpha1.Workflow, error)

func (*Client) IsKubernetesMode

func (k *Client) IsKubernetesMode() bool

IsKubernetesMode returns true since this is the Kubernetes implementation.

func (*Client) ListMCPServers

func (k *Client) ListMCPServers(ctx context.Context, namespace string) ([]musterv1alpha1.MCPServer, error)

func (*Client) ListWorkflows

func (k *Client) ListWorkflows(ctx context.Context, namespace string) ([]musterv1alpha1.Workflow, error)

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) Scheme

func (k *Client) Scheme() *runtime.Scheme

Scheme returns the runtime scheme used by this client.

func (*Client) UpdateMCPServer

func (k *Client) UpdateMCPServer(ctx context.Context, server *musterv1alpha1.MCPServer) error

func (*Client) UpdateMCPServerStatus

func (k *Client) UpdateMCPServerStatus(ctx context.Context, server *musterv1alpha1.MCPServer) error

func (*Client) UpdateWorkflow

func (k *Client) UpdateWorkflow(ctx context.Context, w *musterv1alpha1.Workflow) error

func (*Client) UpdateWorkflowStatus

func (k *Client) UpdateWorkflowStatus(ctx context.Context, w *musterv1alpha1.Workflow) error

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.

Jump to

Keyboard shortcuts

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