diff --git a/pkg/controller/pod/pod.go b/pkg/controller/pod/pod.go index 34d0e56..f1d35f8 100644 --- a/pkg/controller/pod/pod.go +++ b/pkg/controller/pod/pod.go @@ -326,6 +326,24 @@ func LinksEnv(c *gin.Context) { amis.WriteJsonList(c, env) } +func LinksEnvFromPod(c *gin.Context) { + name := c.Param("name") + ns := c.Param("ns") + ctx := c.Request.Context() + selectedCluster := amis.GetSelectedCluster(c) + + env, err := kom.Cluster(selectedCluster).WithContext(ctx). + Resource(&v1.Pod{}). + Namespace(ns). + Name(name). + WithCache(linkCacheTTL).Ctl().Pod().LinkedEnvFromPod() + if err != nil { + amis.WriteJsonError(c, err) + return + } + amis.WriteJsonList(c, env) +} + func LinksConfigMap(c *gin.Context) { name := c.Param("name") ns := c.Param("ns")