|
| 1 | +/* |
| 2 | +Copyright 2025 Agentic Layer. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1alpha1 |
| 18 | + |
| 19 | +import ( |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | +) |
| 22 | + |
| 23 | +// AgentRuntimeConfigurationSpec defines the desired state of AgentRuntimeConfiguration. |
| 24 | +type AgentRuntimeConfigurationSpec struct { |
| 25 | + // AgentTemplateImages defines the default template images for different agent frameworks. |
| 26 | + // These images are used when an Agent resource does not specify a custom image. |
| 27 | + // +optional |
| 28 | + AgentTemplateImages *AgentTemplateImages `json:"agentTemplateImages,omitempty"` |
| 29 | +} |
| 30 | + |
| 31 | +// AgentTemplateImages defines template images for agent frameworks. |
| 32 | +type AgentTemplateImages struct { |
| 33 | + // GoogleAdk is the template image for the Google ADK framework. |
| 34 | + // If not specified, the operator's built-in default will be used. |
| 35 | + // +optional |
| 36 | + GoogleAdk string `json:"googleAdk,omitempty"` |
| 37 | + |
| 38 | + // Additional framework images can be added here in the future, e.g.: |
| 39 | + // LangChain string `json:"langChain,omitempty"` |
| 40 | + // CrewAI string `json:"crewAi,omitempty"` |
| 41 | +} |
| 42 | + |
| 43 | +// AgentRuntimeConfigurationStatus defines the observed state of AgentRuntimeConfiguration. |
| 44 | +type AgentRuntimeConfigurationStatus struct { |
| 45 | + // Conditions represent the latest available observations of the configuration's state. |
| 46 | + // +optional |
| 47 | + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` |
| 48 | +} |
| 49 | + |
| 50 | +// +kubebuilder:object:root=true |
| 51 | +// +kubebuilder:subresource:status |
| 52 | +// +kubebuilder:printcolumn:name="Google ADK Image",type=string,JSONPath=`.spec.agentTemplateImages.googleAdk` |
| 53 | +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" |
| 54 | + |
| 55 | +// AgentRuntimeConfiguration is the Schema for the agentruntimeconfigurations API. |
| 56 | +// It provides namespace-scoped configuration for the agent-runtime-operator. |
| 57 | +type AgentRuntimeConfiguration struct { |
| 58 | + metav1.TypeMeta `json:",inline"` |
| 59 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 60 | + |
| 61 | + Spec AgentRuntimeConfigurationSpec `json:"spec,omitempty"` |
| 62 | + Status AgentRuntimeConfigurationStatus `json:"status,omitempty"` |
| 63 | +} |
| 64 | + |
| 65 | +// +kubebuilder:object:root=true |
| 66 | + |
| 67 | +// AgentRuntimeConfigurationList contains a list of AgentRuntimeConfiguration. |
| 68 | +type AgentRuntimeConfigurationList struct { |
| 69 | + metav1.TypeMeta `json:",inline"` |
| 70 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 71 | + Items []AgentRuntimeConfiguration `json:"items"` |
| 72 | +} |
| 73 | + |
| 74 | +func init() { |
| 75 | + SchemeBuilder.Register(&AgentRuntimeConfiguration{}, &AgentRuntimeConfigurationList{}) |
| 76 | +} |
0 commit comments