Open testwill opened 4 months ago
req := clientset.CoreV1().RESTClient().Post().
Resource("pods").
Name(pod.Name).
Namespace(targetNamespace).
SubResource("exec")
// 设置 Exec 请求的参数
req.VersionedParams(&corev1.PodExecOptions{
Container: container.Name,
Command: []string{"sh", "-c", "find / -name '*.jar'"},
Stdin: false,
Stdout: true,
Stderr: true,
}, clientset.CoreV1().RESTClient().ParameterCodec)
// 执行 Exec 请求
executor, err := remotecommand.NewSPDYExecutor(config, "POST", req.URL())
if err != nil {
log.Printf("Failed to create executor: %v", err)
continue
}
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
Is it that the pod itself does not support the find operation? There is a find command in the remote pod, and the pod that executes the remote find has admin privileges? error: command terminated with exit code 1