Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
| ... | ... |
@@ -65,7 +65,7 @@ func NewExecCommand(dockerCli *command.DockerCli) *cobra.Command {
|
| 65 | 65 |
} |
| 66 | 66 |
|
| 67 | 67 |
func runExec(dockerCli *command.DockerCli, opts *execOptions, container string, execCmd []string) error {
|
| 68 |
- execConfig, err := parseExec(opts, container, execCmd) |
|
| 68 |
+ execConfig, err := parseExec(opts, execCmd) |
|
| 69 | 69 |
// just in case the ParseExec does not exit |
| 70 | 70 |
if container == "" || err != nil {
|
| 71 | 71 |
return cli.StatusError{StatusCode: 1}
|
| ... | ... |
@@ -181,14 +181,13 @@ func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, e |
| 181 | 181 |
|
| 182 | 182 |
// parseExec parses the specified args for the specified command and generates |
| 183 | 183 |
// an ExecConfig from it. |
| 184 |
-func parseExec(opts *execOptions, container string, execCmd []string) (*types.ExecConfig, error) {
|
|
| 184 |
+func parseExec(opts *execOptions, execCmd []string) (*types.ExecConfig, error) {
|
|
| 185 | 185 |
execConfig := &types.ExecConfig{
|
| 186 | 186 |
User: opts.user, |
| 187 | 187 |
Privileged: opts.privileged, |
| 188 | 188 |
Tty: opts.tty, |
| 189 | 189 |
Cmd: execCmd, |
| 190 | 190 |
Detach: opts.detach, |
| 191 |
- // container is not used here |
|
| 192 | 191 |
} |
| 193 | 192 |
|
| 194 | 193 |
// If -d is not set, attach to everything by default |
| ... | ... |
@@ -7,9 +7,8 @@ import ( |
| 7 | 7 |
) |
| 8 | 8 |
|
| 9 | 9 |
type arguments struct {
|
| 10 |
- options execOptions |
|
| 11 |
- container string |
|
| 12 |
- execCmd []string |
|
| 10 |
+ options execOptions |
|
| 11 |
+ execCmd []string |
|
| 13 | 12 |
} |
| 14 | 13 |
|
| 15 | 14 |
func TestParseExec(t *testing.T) {
|
| ... | ... |
@@ -73,7 +72,7 @@ func TestParseExec(t *testing.T) {
|
| 73 | 73 |
} |
| 74 | 74 |
|
| 75 | 75 |
for valid, expectedExecConfig := range valids {
|
| 76 |
- execConfig, err := parseExec(&valid.options, valid.container, valid.execCmd) |
|
| 76 |
+ execConfig, err := parseExec(&valid.options, valid.execCmd) |
|
| 77 | 77 |
if err != nil {
|
| 78 | 78 |
t.Fatal(err) |
| 79 | 79 |
} |
| ... | ... |
@@ -24,7 +24,7 @@ Options: |
| 24 | 24 |
--help Print usage |
| 25 | 25 |
``` |
| 26 | 26 |
|
| 27 |
-List the changed files and directories in a container᾿s filesystem |
|
| 27 |
+List the changed files and directories in a container᾿s filesystem. |
|
| 28 | 28 |
There are 3 events that are listed in the `diff`: |
| 29 | 29 |
|
| 30 | 30 |
1. `A` - Add |