Skip to content

Commit ae82ed1

Browse files
syn-zhuclaude
andcommitted
fix: set appProtocol on agent Service ports for A2A discovery
Set `appProtocol: kgateway.dev/a2a` on the Service port created for each Agent CR so AgentGateway's A2A plugin can discover agent Services directly via protocol matching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Simon Zhu <simon.zhu@mongodb.com>
1 parent 97a5014 commit ae82ed1

33 files changed

Lines changed: 36 additions & 3 deletions

go/core/internal/controller/translator/agent/adk_api_translator.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,10 @@ func (a *adkApiTranslator) buildManifest(
544544
Spec: corev1.ServiceSpec{
545545
Selector: selectorLabels,
546546
Ports: []corev1.ServicePort{{
547-
Name: "http",
548-
Port: dep.Port,
549-
TargetPort: intstr.FromInt(int(dep.Port)),
547+
Name: "http",
548+
Port: dep.Port,
549+
TargetPort: intstr.FromInt(int(dep.Port)),
550+
AppProtocol: ptr.To("kgateway.dev/a2a"),
550551
}},
551552
Type: corev1.ServiceTypeClusterIP,
552553
},

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_allowed_headers.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@
282282
"spec": {
283283
"ports": [
284284
{
285+
"appProtocol": "kgateway.dev/a2a",
285286
"name": "http",
286287
"port": 8080,
287288
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_code.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
"spec": {
278278
"ports": [
279279
{
280+
"appProtocol": "kgateway.dev/a2a",
280281
"name": "http",
281282
"port": 8080,
282283
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_context_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293
"spec": {
294294
"ports": [
295295
{
296+
"appProtocol": "kgateway.dev/a2a",
296297
"name": "http",
297298
"port": 8080,
298299
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_cross_namespace_tools.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
"spec": {
289289
"ports": [
290290
{
291+
"appProtocol": "kgateway.dev/a2a",
291292
"name": "http",
292293
"port": 8080,
293294
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_custom_sa.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@
241241
"spec": {
242242
"ports": [
243243
{
244+
"appProtocol": "kgateway.dev/a2a",
244245
"name": "http",
245246
"port": 8080,
246247
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_embedding_provider.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@
298298
"spec": {
299299
"ports": [
300300
{
301+
"appProtocol": "kgateway.dev/a2a",
301302
"name": "http",
302303
"port": 8080,
303304
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_git_skills.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
"spec": {
319319
"ports": [
320320
{
321+
"appProtocol": "kgateway.dev/a2a",
321322
"name": "http",
322323
"port": 8080,
323324
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_http_toolserver.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@
281281
"spec": {
282282
"ports": [
283283
{
284+
"appProtocol": "kgateway.dev/a2a",
284285
"name": "http",
285286
"port": 8080,
286287
"targetPort": 8080

go/core/internal/controller/translator/agent/testdata/outputs/agent_with_mcp_service.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
"spec": {
278278
"ports": [
279279
{
280+
"appProtocol": "kgateway.dev/a2a",
280281
"name": "http",
281282
"port": 8080,
282283
"targetPort": 8080

0 commit comments

Comments
 (0)