Add aliases and conversion from the kftray.

This commit is contained in:
2025-11-23 15:42:42 +00:00
parent f50f0a9b49
commit 555f21c6f3
6 changed files with 532 additions and 8 deletions
+24
View File
@@ -140,6 +140,18 @@ func TestForward_ID(t *testing.T) {
},
expectedID: "staging/web/pod:8081",
},
{
name: "forward with alias",
forward: Forward{
Resource: "service/postgres",
Port: 5432,
LocalPort: 5432,
Alias: "shared-postgres",
contextName: "home",
namespaceName: "shared-resources",
},
expectedID: "shared-postgres:5432",
},
}
for _, tt := range tests {
@@ -190,6 +202,18 @@ func TestForward_String(t *testing.T) {
},
expectedString: "staging/web/pod[app=nginx,env=prod]:80→8081",
},
{
name: "forward with alias",
forward: Forward{
Resource: "service/redis",
Port: 6379,
LocalPort: 6379,
Alias: "redis-at-home",
contextName: "home",
namespaceName: "shared-resources",
},
expectedString: "redis-at-home:6379→6379",
},
}
for _, tt := range tests {