Skip to content

Commit abed337

Browse files
committed
kubectl: TEMP hack to exec debug container
1 parent 0ea699f commit abed337

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pkg/kubectl/cmd/exec.go

+13-7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ func NewCmdExec(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *c
8686
cmd.Flags().StringVarP(&options.PodName, "pod", "p", "", "Pod name")
8787
// TODO support UID
8888
cmd.Flags().StringVarP(&options.ContainerName, "container", "c", "", "Container name. If omitted, the first container in the pod will be chosen")
89+
cmd.Flags().StringVarP(&options.DebugName, "debug", "d", "", "Debug Container name.")
90+
cmd.Flags().StringVarP(&options.DebugImage, "image", "m", "", "Debug Container image.")
8991
cmd.Flags().BoolVarP(&options.Stdin, "stdin", "i", false, "Pass stdin to the container")
9092
cmd.Flags().BoolVarP(&options.TTY, "tty", "t", false, "Stdin is a TTY")
9193
return cmd
@@ -136,7 +138,9 @@ type StreamOptions struct {
136138
type ExecOptions struct {
137139
StreamOptions
138140

139-
Command []string
141+
Command []string
142+
DebugName string
143+
DebugImage string
140144

141145
FullCmdName string
142146
SuggestedCmdUsage string
@@ -314,12 +318,14 @@ func (p *ExecOptions) Run() error {
314318
SubResource("exec").
315319
Param("container", containerName)
316320
req.VersionedParams(&api.PodExecOptions{
317-
Container: containerName,
318-
Command: p.Command,
319-
Stdin: p.Stdin,
320-
Stdout: p.Out != nil,
321-
Stderr: p.Err != nil,
322-
TTY: t.Raw,
321+
Container: containerName,
322+
Command: p.Command,
323+
Stdin: p.Stdin,
324+
Stdout: p.Out != nil,
325+
Stderr: p.Err != nil,
326+
TTY: t.Raw,
327+
AlphaName: p.DebugName,
328+
AlphaImage: p.DebugImage,
323329
}, api.ParameterCodec)
324330

325331
return p.Executor.Execute("POST", req.URL(), p.Config, p.In, p.Out, p.Err, t.Raw, sizeQueue)

0 commit comments

Comments
 (0)