当前位置: 首页>>代码示例>>Golang>>正文


Golang PortForwardRequest.GetPodSandboxId方法代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/kubelet/api/v1alpha1/runtime.PortForwardRequest.GetPodSandboxId方法的典型用法代码示例。如果您正苦于以下问题:Golang PortForwardRequest.GetPodSandboxId方法的具体用法?Golang PortForwardRequest.GetPodSandboxId怎么用?Golang PortForwardRequest.GetPodSandboxId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在k8s/io/kubernetes/pkg/kubelet/api/v1alpha1/runtime.PortForwardRequest的用法示例。


在下文中一共展示了PortForwardRequest.GetPodSandboxId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: PortForward

// PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (ds *dockerService) PortForward(req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) {
	if ds.streamingServer == nil {
		return nil, streaming.ErrorStreamingDisabled("port forward")
	}
	_, err := checkContainerStatus(ds.client, req.GetPodSandboxId())
	if err != nil {
		return nil, err
	}
	// TODO(timstclair): Verify that ports are exposed.
	return ds.streamingServer.GetPortForward(req)
}
开发者ID:oszi,项目名称:kubernetes,代码行数:12,代码来源:docker_streaming.go

示例2: PortForward

// PortForward prepares a streaming endpoint to forward ports from a PodSandbox, and returns the address.
func (r *RemoteRuntimeService) PortForward(req *runtimeApi.PortForwardRequest) (*runtimeApi.PortForwardResponse, error) {
	ctx, cancel := getContextWithTimeout(r.timeout)
	defer cancel()

	resp, err := r.runtimeClient.PortForward(ctx, req)
	if err != nil {
		glog.Errorf("PortForward %s from runtime service failed: %v", req.GetPodSandboxId(), err)
		return nil, err
	}

	return resp, nil
}
开发者ID:eljefedelrodeodeljefe,项目名称:kubernetes,代码行数:13,代码来源:remote_runtime.go

示例3: GetPortForward

func (s *server) GetPortForward(req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) {
	if req.GetPodSandboxId() == "" {
		return nil, grpc.Errorf(codes.InvalidArgument, "missing required pod_sandbox_id")
	}
	token, err := s.cache.Insert(req)
	if err != nil {
		return nil, err
	}
	return &runtimeapi.PortForwardResponse{
		Url: s.buildURL("portforward", token),
	}, nil
}
开发者ID:kubernetes,项目名称:kubernetes,代码行数:12,代码来源:server.go

示例4: GetPortForward

func (s *server) GetPortForward(req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) {
	url := s.buildURL("portforward", req.GetPodSandboxId(), streamOpts{})
	return &runtimeapi.PortForwardResponse{
		Url: &url,
	}, nil
}
开发者ID:alex-mohr,项目名称:kubernetes,代码行数:6,代码来源:server.go


注:本文中的k8s/io/kubernetes/pkg/kubelet/api/v1alpha1/runtime.PortForwardRequest.GetPodSandboxId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。