@@ -34,6 +34,7 @@ import (
3434
3535const (
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
0 commit comments