Skip to main content
Glama
port_forward_test.go492 B
package example import ( "fmt" "testing" "time" "github.com/weibaohui/kom/kom" v1 "k8s.io/api/core/v1" ) func TestPortForward(t *testing.T) { stopCh := make(chan struct{}) go func() { time.Sleep(time.Minute) stopCh <- struct{}{} }() err := kom.DefaultCluster().Resource(&v1.Pod{}). Namespace("default"). Name("nginx-deployment-f576985cc-7czqr"). Ctl().Pod(). ContainerName("nginx"). PortForward("20088", "80", stopCh).Error if err != nil { fmt.Println(err) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/weibaohui/kom'

If you have feedback or need assistance with the MCP directory API, please join our Discord server