Skip to content

Commit 092184e

Browse files
committed
feat: Add MSAF framework support
1 parent 6ea021c commit 092184e

8 files changed

Lines changed: 37 additions & 7 deletions

api/v1alpha1/agent_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type AgentTool struct {
104104
// AgentSpec defines the desired state of Agent.
105105
type AgentSpec struct {
106106
// Framework defines the supported agent frameworks
107-
// +kubebuilder:validation:Enum=google-adk;custom
107+
// +kubebuilder:validation:Enum=google-adk;msaf;custom
108108
// +optional
109109
Framework string `json:"framework,omitempty"`
110110

api/v1alpha1/agentruntimeconfiguration_types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ type AgentTemplateImages struct {
3535
// +optional
3636
GoogleAdk string `json:"googleAdk,omitempty"`
3737

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"`
38+
// Msaf is the template image for the Microsoft Agent Framework (MSAF).
39+
// If not specified, the operator's built-in default will be used.
40+
// +optional
41+
Msaf string `json:"msaf,omitempty"`
4142
}
4243

4344
// AgentRuntimeConfigurationStatus defines the observed state of AgentRuntimeConfiguration.
@@ -50,6 +51,7 @@ type AgentRuntimeConfigurationStatus struct {
5051
// +kubebuilder:object:root=true
5152
// +kubebuilder:subresource:status
5253
// +kubebuilder:printcolumn:name="Google ADK Image",type=string,JSONPath=`.spec.agentTemplateImages.googleAdk`
54+
// +kubebuilder:printcolumn:name="MSAF Image",type=string,JSONPath=`.spec.agentTemplateImages.msaf`
5355
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
5456

5557
// AgentRuntimeConfiguration is the Schema for the agentruntimeconfigurations API.

config/crd/bases/runtime.agentic-layer.ai_agentruntimeconfigurations.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ spec:
1818
- jsonPath: .spec.agentTemplateImages.googleAdk
1919
name: Google ADK Image
2020
type: string
21+
- jsonPath: .spec.agentTemplateImages.msaf
22+
name: MSAF Image
23+
type: string
2124
- jsonPath: .metadata.creationTimestamp
2225
name: Age
2326
type: date
@@ -59,6 +62,11 @@ spec:
5962
GoogleAdk is the template image for the Google ADK framework.
6063
If not specified, the operator's built-in default will be used.
6164
type: string
65+
msaf:
66+
description: |-
67+
Msaf is the template image for the Microsoft Agent Framework (MSAF).
68+
If not specified, the operator's built-in default will be used.
69+
type: string
6270
type: object
6371
type: object
6472
status:

config/crd/bases/runtime.agentic-layer.ai_agents.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ spec:
329329
description: Framework defines the supported agent frameworks
330330
enum:
331331
- google-adk
332+
- msaf
332333
- custom
333334
type: string
334335
image:

config/samples/runtime_v1alpha1_agentruntimeconfiguration.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ spec:
88
# Customize the default template image for Google ADK framework agents
99
# This will be used when an Agent resource does not specify a custom image
1010
googleAdk: "ghcr.io/agentic-layer/agent-template-adk:0.8.0"
11+
# Customize the default template image for Microsoft Agent Framework (MSAF) agents
12+
msaf: "ghcr.io/agentic-layer/agent-template-msaf:0.1.0"

internal/controller/agent_reconciler.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const (
4444
agentContainerName = "agent"
4545
agentCardEndpoint = "/.well-known/agent-card.json"
4646
googleAdkFramework = "google-adk"
47+
msafFramework = "msaf"
4748
defaultTemplateImageAdk = "ghcr.io/agentic-layer/agent-template-adk:0.8.0"
49+
defaultTemplateImageMsaf = "ghcr.io/agentic-layer/agent-template-msaf:0.1.0"
4850
defaultTemplateImageFallback = "invalid"
4951
)
5052

@@ -490,13 +492,19 @@ func (r *AgentReconciler) getTemplateImage(framework string, config *runtimev1al
490492
if config.Spec.AgentTemplateImages.GoogleAdk != "" {
491493
return config.Spec.AgentTemplateImages.GoogleAdk
492494
}
495+
case msafFramework:
496+
if config.Spec.AgentTemplateImages.Msaf != "" {
497+
return config.Spec.AgentTemplateImages.Msaf
498+
}
493499
}
494500
}
495501

496502
// Fall back to built-in defaults
497503
switch framework {
498504
case googleAdkFramework:
499505
return defaultTemplateImageAdk
506+
case msafFramework:
507+
return defaultTemplateImageMsaf
500508
default:
501509
// Validation will catch unsupported frameworks without images
502510
// This shouldn't be reached due to validation, but set template as fallback

internal/webhook/v1alpha1/agent_webhook.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
const (
3636
googleAdkFramework = "google-adk"
37+
msafFramework = "msaf"
3738
)
3839

3940
// agentlog is for logging in this package.
@@ -54,6 +55,7 @@ func SetupAgentWebhookWithManager(mgr ctrl.Manager) error {
5455
DefaultReplicas: 1,
5556
DefaultPort: 8080,
5657
DefaultPortGoogleAdk: 8000,
58+
DefaultPortMsaf: 8000,
5759
Recorder: mgr.GetEventRecorder("agent-defaulter-webhook"),
5860
}).
5961
WithValidator(&AgentCustomValidator{}).
@@ -72,6 +74,7 @@ type AgentCustomDefaulter struct {
7274
DefaultReplicas int32
7375
DefaultPort int32
7476
DefaultPortGoogleAdk int32
77+
DefaultPortMsaf int32
7578
Recorder events.EventRecorder
7679
}
7780

@@ -119,6 +122,8 @@ func (d *AgentCustomDefaulter) frameworkDefaultPort(framework string) int32 {
119122
switch framework {
120123
case googleAdkFramework:
121124
return d.DefaultPortGoogleAdk
125+
case msafFramework:
126+
return d.DefaultPortMsaf
122127
default:
123128
return d.DefaultPort // Default port for unknown frameworks
124129
}
@@ -159,11 +164,15 @@ func (v *AgentCustomValidator) validateAgent(agent *runtimev1alpha1.Agent) (admi
159164
var allErrs field.ErrorList
160165

161166
// Validate framework and image combination
162-
if agent.Spec.Image == "" && agent.Spec.Framework != googleAdkFramework {
167+
templateFrameworks := map[string]bool{
168+
googleAdkFramework: true,
169+
msafFramework: true,
170+
}
171+
if agent.Spec.Image == "" && !templateFrameworks[agent.Spec.Framework] {
163172
allErrs = append(allErrs, field.Invalid(
164173
field.NewPath("spec", "framework"),
165174
agent.Spec.Framework,
166-
fmt.Sprintf("framework %q requires a custom image. Template agents are only supported for %q framework", agent.Spec.Framework, googleAdkFramework),
175+
fmt.Sprintf("framework %q requires a custom image. Template agents are only supported for frameworks: %s", agent.Spec.Framework, "google-adk, msaf"),
167176
))
168177
}
169178

internal/webhook/v1alpha1/agent_webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ var _ = Describe("Agent Webhook", func() {
319319
By("verifying that validation fails")
320320
Expect(err).To(HaveOccurred())
321321
Expect(err.Error()).To(ContainSubstring("framework \"custom\" requires a custom image"))
322-
Expect(err.Error()).To(ContainSubstring("Template agents are only supported for \"google-adk\" framework"))
322+
Expect(err.Error()).To(ContainSubstring("Template agents are only supported for frameworks: google-adk, msaf"))
323323
Expect(warnings).To(BeEmpty())
324324
})
325325

0 commit comments

Comments
 (0)