Merge pull request #7773 from csrwng/fix_podexecopt

Fix command field PodExecOptions
This commit is contained in:
Maxwell Forbes 2015-05-05 12:14:58 -07:00
commit 39f3260ce0
8 changed files with 37 additions and 15 deletions

View File

@ -1353,8 +1353,8 @@ type PodExecOptions struct {
// Container in which to execute the command.
Container string
// Command is the remote command to execute
Command string
// Command is the remote command to execute; argv array; not executed within a shell.
Command []string
}
// PodProxyOptions is the query options to a Pod's proxy call

View File

@ -1715,7 +1715,12 @@ func init() {
out.Stderr = in.Stderr
out.TTY = in.TTY
out.Container = in.Container
out.Command = in.Command
if in.Command != nil {
out.Command = make([]string, len(in.Command))
for i := range in.Command {
out.Command[i] = in.Command[i]
}
}
return nil
},
func(in *newer.PodExecOptions, out *PodExecOptions, s conversion.Scope) error {
@ -1727,7 +1732,12 @@ func init() {
out.Stderr = in.Stderr
out.TTY = in.TTY
out.Container = in.Container
out.Command = in.Command
if in.Command != nil {
out.Command = make([]string, len(in.Command))
for i := range in.Command {
out.Command[i] = in.Command[i]
}
}
return nil
},
func(in *PodList, out *newer.PodList, s conversion.Scope) error {

View File

@ -1339,8 +1339,8 @@ type PodExecOptions struct {
// Container in which to execute the command.
Container string `json:"container,omitempty" description:"the container in which to execute the command. Defaults to only container if there is only one container in the pod."`
// Command is the remote command to execute
Command string `json:"command" description:"the command to execute"`
// Command is the remote command to execute; argv array; not executed within a shell.
Command []string `json:"command" description:"the command to execute; argv array; not executed within a shell"`
}
// PodProxyOptions is the query options to a Pod's proxy call

View File

@ -1207,8 +1207,8 @@ type PodExecOptions struct {
// Container in which to execute the command.
Container string `json:"container,omitempty" description:"the container in which to execute the command. Defaults to only container if there is only one container in the pod."`
// Command is the remote command to execute
Command string `json:"command" description:"the command to execute"`
// Command is the remote command to execute; argv array; not executed within a shell.
Command []string `json:"command" description:"the command to execute; argv array; not executed within a shell"`
}
// PodProxyOptions is the query options to a Pod's proxy call

View File

@ -1227,8 +1227,8 @@ type PodExecOptions struct {
// Container in which to execute the command.
Container string `json:"container,omitempty" description:"the container in which to execute the command. Defaults to only container if there is only one container in the pod."`
// Command is the remote command to execute
Command string `json:"command" description:"the command to execute"`
// Command is the remote command to execute; argv array; not executed within a shell.
Command []string `json:"command" description:"the command to execute; argv array; not executed within a shell"`
}
// PodProxyOptions is the query options to a Pod's proxy call

View File

@ -1850,7 +1850,12 @@ func convert_v1beta3_PodExecOptions_To_api_PodExecOptions(in *PodExecOptions, ou
out.Stderr = in.Stderr
out.TTY = in.TTY
out.Container = in.Container
out.Command = in.Command
if in.Command != nil {
out.Command = make([]string, len(in.Command))
for i := range in.Command {
out.Command[i] = in.Command[i]
}
}
return nil
}
@ -1863,7 +1868,12 @@ func convert_api_PodExecOptions_To_v1beta3_PodExecOptions(in *newer.PodExecOptio
out.Stderr = in.Stderr
out.TTY = in.TTY
out.Container = in.Container
out.Command = in.Command
if in.Command != nil {
out.Command = make([]string, len(in.Command))
for i := range in.Command {
out.Command[i] = in.Command[i]
}
}
return nil
}

View File

@ -1339,8 +1339,8 @@ type PodExecOptions struct {
// Container in which to execute the command.
Container string `json:"container,omitempty" description:"the container in which to execute the command. Defaults to only container if there is only one container in the pod."`
// Command is the remote command to execute
Command string `json:"command" description:"the command to execute"`
// Command is the remote command to execute; argv array; not executed within a shell.
Command []string `json:"command" description:"the command to execute; argv array; not executed within a shell"`
}
// PodProxyOptions is the query options to a Pod's proxy call

View File

@ -261,7 +261,9 @@ func ExecLocation(getter ResourceGetter, connInfo client.ConnectionInfoGetter, c
if opts.TTY {
params.Add(api.ExecTTYParam, "1")
}
params.Add("command", opts.Command)
for _, c := range opts.Command {
params.Add("command", c)
}
loc := &url.URL{
Scheme: nodeScheme,
Host: fmt.Sprintf("%s:%d", nodeHost, nodePort),