Help us shape the future of Go! Take the 2026 Go Developer Survey

v1beta1

package
v0.0.0-...-ea0a6b8 Latest Latest
Warning

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

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

Documentation

Overview

Package v1beta1 contains API Schema definitions for the assistant v1beta1 API group. +kubebuilder:object:generate=true +groupName=assistant.openstack.org

Index

Constants

View Source
const (
	// OpenStackAssistantReadyInitMessage
	OpenStackAssistantReadyInitMessage = "OpenStack Assistant not started"

	// OpenStackAssistantReadyRunningMessage
	OpenStackAssistantReadyRunningMessage = "OpenStack Assistant in progress"

	// OpenStackAssistantReadyMessage
	OpenStackAssistantReadyMessage = "OpenStack Assistant created"

	// OpenStackAssistantReadyErrorMessage
	OpenStackAssistantReadyErrorMessage = "OpenStack Assistant error occurred %s"

	// OpenStackAssistantExtraConfigWaitingMessage
	OpenStackAssistantExtraConfigWaitingMessage = "Waiting for extraConfig ConfigMap %s"
)

Common Messages used by API objects.

View Source
const (
	// OpenStackAssistantContainerImage is the fall-back container image for OpenStackAssistant
	OpenStackAssistantContainerImage = "quay.io/openstack-s2i-containers/openstack-goose:master-latest"

	// AssistantDefaultWorkingDir is the default writable working directory (also
	// used as HOME) for the assistant's configuration, sessions, and runtime state.
	AssistantDefaultWorkingDir = "/home/goose"
)
View Source
const (
	// OpenStackAssistantReadyCondition Status=True condition which indicates if OpenStackAssistant is configured and operational
	OpenStackAssistantReadyCondition condition.Type = "OpenStackAssistantReady"
)

OpenStackAssistant Condition Types used by API objects.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "assistant.openstack.org", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func SetupDefaults

func SetupDefaults()

SetupDefaults - initializes any CRD field defaults based on environment variables

func SetupOpenStackAssistantDefaults

func SetupOpenStackAssistantDefaults(defaults OpenStackAssistantDefaults)

SetupOpenStackAssistantDefaults - initialize OpenStackAssistant spec defaults

Types

type ConfigMount

type ConfigMount struct {
	// Name of a ConfigMap in the same namespace.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// MountPath is the absolute directory the ConfigMap keys are projected to.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=`^/[^\p{Cc}]*$`
	MountPath string `json:"mountPath"`
}

ConfigMount projects a ConfigMap into the assistant pod at a caller-chosen path. The meaning of the mounted files is defined entirely by the image entrypoint (e.g. a Goose image may read recipes, skills or hints from the mounted paths). The operator only mounts the data and tracks it so that content changes trigger a pod restart.

func (*ConfigMount) DeepCopy

func (in *ConfigMount) DeepCopy() *ConfigMount

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMount.

func (*ConfigMount) DeepCopyInto

func (in *ConfigMount) DeepCopyInto(out *ConfigMount)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LightspeedStackSpec

type LightspeedStackSpec struct {
	// BaseURL of the Lightspeed Stack OpenAI-compatible endpoint,
	// e.g. "https://lightspeed-app-server.openstack.svc:8443/v1".
	// Exposed to the assistant container as the LIGHTSPEED_URL env var.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern=`^https?://[^\p{Cc}]+$`
	BaseURL string `json:"baseURL"`

	// Model identifier, e.g. "gemini/models/gemini-2.5-flash".
	// Exposed to the assistant container as the LIGHTSPEED_MODEL env var.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Model string `json:"model"`

	// AdditionalModels are extra models the agent may select per subagent, e.g.
	// a heavier model for adversarial cross-review or a cheaper model for simple
	// tasks. Exposed to the container as the LIGHTSPEED_ADDITIONAL_MODELS env var
	// (JSON) for the image entrypoint to render into the harness config.
	// +kubebuilder:validation:Optional
	// +listType=map
	// +listMapKey=name
	AdditionalModels []ModelRef `json:"additionalModels,omitempty"`
}

LightspeedStackSpec defines connectivity to the Lightspeed Stack (LLM backend). The API key is derived at runtime from the pod's service-account token by the image entrypoint; no provider secret is required.

func (*LightspeedStackSpec) DeepCopy

func (in *LightspeedStackSpec) DeepCopy() *LightspeedStackSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LightspeedStackSpec.

func (*LightspeedStackSpec) DeepCopyInto

func (in *LightspeedStackSpec) DeepCopyInto(out *LightspeedStackSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MCPServerRef

type MCPServerRef struct {
	// Name is the MCP server name. It is used to derive the
	// MCP_SERVER_<name> environment variable, so it must be a valid
	// environment-variable name: start with a letter or underscore and
	// contain only letters, digits, and underscores (no dashes).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern=`^[a-zA-Z_][a-zA-Z0-9_]*$`
	Name string `json:"name"`

	// URL is the MCP server's Streamable HTTP endpoint.
	// Mutually exclusive with OpenStackClientRef.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	// ensures that a string contains no control characters
	// +kubebuilder:validation:Pattern=`^[^\p{Cc}]*$`
	URL string `json:"url,omitempty"`

	// OpenStackClientRef is the name of an OpenStackClient CR in the same
	// namespace that has MCP enabled. The controller reads the service URL
	// published in the OpenStackClient status.
	// Mutually exclusive with URL.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	OpenStackClientRef string `json:"openstackClientRef,omitempty"`
}

MCPServerRef references an MCP server endpoint to expose to the assistant. Exactly one of URL or OpenStackClientRef must be specified. +kubebuilder:validation:XValidation:rule="has(self.url) != has(self.openstackClientRef)",message="exactly one of url or openstackClientRef must be set"

func (*MCPServerRef) DeepCopy

func (in *MCPServerRef) DeepCopy() *MCPServerRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MCPServerRef.

func (*MCPServerRef) DeepCopyInto

func (in *MCPServerRef) DeepCopyInto(out *MCPServerRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ModelRef

type ModelRef struct {
	// Name is the model identifier, e.g. "gemini/models/gemini-2.5-pro".
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// BaseURL overrides the LightspeedStack BaseURL for this model. When empty
	// the LightspeedStack BaseURL is used.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Pattern=`^https?://[^\p{Cc}]+$`
	BaseURL string `json:"baseURL,omitempty"`
}

ModelRef describes an additional LLM model the assistant may select, e.g. a heavier model for adversarial cross-review or a cheaper model for simple subagent tasks. Exposed to the container so the image entrypoint can render it into the harness config.

func (*ModelRef) DeepCopy

func (in *ModelRef) DeepCopy() *ModelRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelRef.

func (*ModelRef) DeepCopyInto

func (in *ModelRef) DeepCopyInto(out *ModelRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenStackAssistant

type OpenStackAssistant struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   OpenStackAssistantSpec   `json:"spec,omitempty"`
	Status OpenStackAssistantStatus `json:"status,omitempty"`
}

OpenStackAssistant is the Schema for the openstackassistants API

func (*OpenStackAssistant) DeepCopy

func (in *OpenStackAssistant) DeepCopy() *OpenStackAssistant

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackAssistant.

func (*OpenStackAssistant) DeepCopyInto

func (in *OpenStackAssistant) DeepCopyInto(out *OpenStackAssistant)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OpenStackAssistant) DeepCopyObject

func (in *OpenStackAssistant) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*OpenStackAssistant) Default

func (r *OpenStackAssistant) Default()

Default implements webhook.Defaulter

func (OpenStackAssistant) IsReady

func (instance OpenStackAssistant) IsReady() bool

IsReady - returns true if OpenStackAssistant is reconciled successfully

func (*OpenStackAssistant) RbacConditionsSet

func (instance *OpenStackAssistant) RbacConditionsSet(c *condition.Condition)

RbacConditionsSet - set the conditions for the rbac object

func (OpenStackAssistant) RbacNamespace

func (instance OpenStackAssistant) RbacNamespace() string

RbacNamespace - return the namespace

func (OpenStackAssistant) RbacResourceName

func (instance OpenStackAssistant) RbacResourceName() string

RbacResourceName - return the name to be used for rbac objects (serviceaccount, role, rolebinding)

func (*OpenStackAssistant) ValidateCreate

func (r *OpenStackAssistant) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator

func (*OpenStackAssistant) ValidateDelete

func (r *OpenStackAssistant) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator

func (*OpenStackAssistant) ValidateUpdate

func (r *OpenStackAssistant) ValidateUpdate(_ runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator

func (OpenStackAssistant) WorkingDir

func (instance OpenStackAssistant) WorkingDir() string

WorkingDir returns the writable working directory (also used as HOME) for the assistant, honoring spec.storage.mountPath and falling back to the default.

type OpenStackAssistantDefaults

type OpenStackAssistantDefaults struct {
	ContainerImageURL string
}

OpenStackAssistantDefaults holds defaults for the assistant

func (*OpenStackAssistantDefaults) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackAssistantDefaults.

func (*OpenStackAssistantDefaults) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenStackAssistantList

type OpenStackAssistantList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []OpenStackAssistant `json:"items"`
}

OpenStackAssistantList contains a list of OpenStackAssistant

func (*OpenStackAssistantList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackAssistantList.

func (*OpenStackAssistantList) DeepCopyInto

func (in *OpenStackAssistantList) DeepCopyInto(out *OpenStackAssistantList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OpenStackAssistantList) DeepCopyObject

func (in *OpenStackAssistantList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type OpenStackAssistantSpec

type OpenStackAssistantSpec struct {
	// ContainerImage is the agent/harness image (will be set to the
	// environmental default if empty). Its baked-in entrypoint is responsible
	// for rendering harness config from the env vars and mounts the operator
	// provides.
	// +kubebuilder:validation:Required
	ContainerImage string `json:"containerImage"`

	// LightspeedStack configuration for the AI backend (base URL + model).
	// +kubebuilder:validation:Required
	LightspeedStack LightspeedStackSpec `json:"lightspeedStack"`

	// ExtraConfig is a list of ConfigMaps to project into the pod at chosen
	// paths for the image entrypoint to consume (recipes, skills, hints,
	// system prompts, etc. - all harness-defined).
	// +kubebuilder:validation:Optional
	// +listType=map
	// +listMapKey=name
	ExtraConfig []ConfigMount `json:"extraConfig,omitempty"`

	// MCPServers lists MCP server endpoints to expose to the assistant. Each
	// entry is exported to the pod as an MCP_SERVER_<name> environment variable.
	// +kubebuilder:validation:Optional
	// +listType=map
	// +listMapKey=name
	MCPServers []MCPServerRef `json:"mcpServers,omitempty"`

	// +kubebuilder:validation:Optional
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	// Secret containing any CA certificates which should be added to the assistant pod.
	tls.Ca `json:",inline"`

	// Storage configures the writable working directory (also HOME) used for the
	// agent's configuration, sessions, and runtime state. Defaults to an emptyDir
	// mounted at /home/goose; an existing PVC can be used to persist its contents.
	// +kubebuilder:validation:Optional
	Storage *StorageSpec `json:"storage,omitempty"`

	// Resources defines the compute resource requirements for the assistant
	// container. This is useful for agent workloads that run concurrent processes.
	// +kubebuilder:validation:Optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// NodeSelector to target subset of worker nodes for pod scheduling.
	// +kubebuilder:validation:Optional
	NodeSelector *map[string]string `json:"nodeSelector,omitempty"`

	// Env is a list of additional environment variables for the container.
	// +kubebuilder:validation:Optional
	// +listType=map
	// +listMapKey=name
	Env []corev1.EnvVar `json:"env,omitempty"`
}

OpenStackAssistantSpec defines the desired state of OpenStackAssistant

func (*OpenStackAssistantSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackAssistantSpec.

func (*OpenStackAssistantSpec) DeepCopyInto

func (in *OpenStackAssistantSpec) DeepCopyInto(out *OpenStackAssistantSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OpenStackAssistantStatus

type OpenStackAssistantStatus struct {
	// PodName is the name of the running assistant pod
	PodName string `json:"podName,omitempty"`

	// Conditions tracks the state of each sub-resource
	Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`

	// ObservedGeneration - the most recent generation observed
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Hash tracks input hashes to detect changes
	Hash map[string]string `json:"hash,omitempty"`
}

OpenStackAssistantStatus defines the observed state of OpenStackAssistant

func (*OpenStackAssistantStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackAssistantStatus.

func (*OpenStackAssistantStatus) DeepCopyInto

func (in *OpenStackAssistantStatus) DeepCopyInto(out *OpenStackAssistantStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageSpec

type StorageSpec struct {
	// MountPath is the writable working directory, also exported as HOME.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=/home/goose
	// +kubebuilder:validation:Pattern=`^/[^\p{Cc}]*$`
	MountPath string `json:"mountPath,omitempty"`

	// PVCName, when set, backs the working directory with an existing
	// PersistentVolumeClaim instead of an ephemeral emptyDir, persisting state
	// across pod replacement and node reboots.
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:MinLength=1
	PVCName string `json:"pvcName,omitempty"`
}

StorageSpec configures the writable working directory used by the agent for configuration, sessions, and runtime state. A writable directory is required because the pod runs as a non-root, arbitrary UID with only read-only ConfigMap mounts otherwise.

func (*StorageSpec) DeepCopy

func (in *StorageSpec) DeepCopy() *StorageSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.

func (*StorageSpec) DeepCopyInto

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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