| 72 | } |
| 73 | |
| 74 | func (p *PodExec) Command(arg ...string) *exec.Cmd { |
| 75 | extArgs := []string{"-n", p.namespace, "exec", p.name, "--"} |
| 76 | if p.container != "" { |
| 77 | extArgs = []string{"-n", p.namespace, "exec", "-c", p.container, p.name, "--"} |
| 78 | } |
| 79 | |
| 80 | extArgs = append(extArgs, arg...) |
| 81 | fmt.Printf(`pod %s/%s exec: "%s"\n`, p.namespace, p.name, strings.Join(arg, `" "`)) |
| 82 | return KubeCtlCommand(extArgs...) |
| 83 | } |
| 84 | |
| 85 | func (p *PodExec) CurlCommand(method string, header map[string]string, data map[string]any, target string) *exec.Cmd { |
| 86 | extArgs := []string{"/usr/bin/curl", target, "-s"} |