add portforwarding support to node/api (#1102)
Co-authored-by: Pablo Borrelli <pablo.borrelli0@gmail.com> Co-authored-by: windyear <1280027646@qq.com>
This commit is contained in:
@@ -37,6 +37,9 @@ type Provider interface {
|
||||
|
||||
// GetMetricsResource gets the metrics for the node, including running pods
|
||||
GetMetricsResource(context.Context) ([]*dto.MetricFamily, error)
|
||||
|
||||
// PortForward forwards a local port to a port on the pod
|
||||
PortForward(ctx context.Context, namespace, pod string, port int32, stream io.ReadWriteCloser) error
|
||||
}
|
||||
|
||||
// ProviderConfig holds objects created by NewNodeFromClient that a provider may need to bootstrap itself.
|
||||
@@ -73,6 +76,7 @@ func AttachProviderRoutes(mux api.ServeMux) NodeOpt {
|
||||
GetMetricsResource: p.GetMetricsResource,
|
||||
StreamIdleTimeout: cfg.StreamIdleTimeout,
|
||||
StreamCreationTimeout: cfg.StreamCreationTimeout,
|
||||
PortForward: p.PortForward,
|
||||
}, true))
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user