-
Notifications
You must be signed in to change notification settings - Fork 18.8k
integration-cli: remove deprecated dockerCmd
and waitRun
utilities
#46088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
93355ac
to
23c7d4c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
985e00b
to
00be3f1
Compare
dbe6b79
to
de03113
Compare
3940c56
to
3d26f90
Compare
dockerCmd
and waitRun
dockerCmd
and waitRun
utilities
3d26f90
to
8516a9f
Compare
8516a9f
to
0748c6f
Compare
0748c6f
to
07dab91
Compare
Unrelated, but interesting failure;
|
07dab91
to
107b7c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'll be honest I half reviewed this, my eyes hurt. It's fine to merge, most of the changes are mechanical
Yeah, it's a pain to review this one; MOST of the changes are mechanical; there are some cases where I made some small "somewhat" changes (e.g. remove intermediate vars while updating, or (as pointed out in a comment above) changed vars to It's been a while since I made this PR, but I recall there were some slightly opinionated changes; e.g. some "utility" lines (e.g. create a container and get its ID from the output) where I swapped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but ouch, my eyes 😅
@@ -136,7 +137,7 @@ func (s *DockerAPISuite) TestPostContainersAttach(c *testing.T) { | |||
} | |||
|
|||
// Create a container that only emits stdout. | |||
cid, _ := dockerCmd(c, "run", "-di", "busybox", "cat") | |||
cid := cli.DockerCmd(c, "run", "-di", "busybox", "cat").Combined() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use .Combined()
here
(see next comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Wrote this pair of comment right when I was starting to review this, but after looking at everything I think you did make the changes to use .Stdout()
when it makes sense, I think this is the only odd one out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, this one definitely can be StdOut()
because we're capturing the output of the CLI (container ID) here, not so much the output of the container's command.
@@ -152,7 +153,7 @@ func (s *DockerAPISuite) TestPostContainersAttach(c *testing.T) { | |||
expectTimeout(wc, br, "stdout") | |||
|
|||
// Test the similar functions of the stderr stream. | |||
cid, _ = dockerCmd(c, "run", "-di", "busybox", "/bin/sh", "-c", "cat >&2") | |||
cid = cli.DockerCmd(c, "run", "-di", "busybox", "/bin/sh", "-c", "cat >&2").Stdout() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then use .Stdout()
here? They're both doing the same thing, just grabbing the container ID to use later, right?
If this was a 1:1 change we should just use .Combined()
everywhere, but if we're making changes that make sense then we could use .Stdout()
for both of these, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess I got confused and thought we could be capturing the container's process output (or maybe I just got fatigued 😂).
repoName := "foobar-save-load-test" | ||
before, _ := dockerCmd(c, "commit", name, repoName) | ||
imgRepoName := "foobar-save-load-test" | ||
before := cli.DockerCmd(c, "commit", name, imgRepoName).Combined() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be a .Stdout()
, right? docker commit
prints to stdout if everything went okay (which seems to be expected here)
|
||
// It *should not* have copied the directory using the target's name, but | ||
// used the given name instead. | ||
unexpectedPath := filepath.Join(testVol, cpTestPathParent) | ||
stat, err := os.Lstat(unexpectedPath) | ||
if err == nil { | ||
out = fmt.Sprintf("target name was copied: %q - %q", stat.Mode(), stat.Name()) | ||
c.Errorf("target name was unexpectedly preserved: %q - %q", stat.Mode(), stat.Name()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much more readable :)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also adding some consts for fixed values. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also renaming vars that collided with package-level vars and using consts for fixed values. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also adding some consts for fixed values. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Also fixed some variables that shadowed package-level vars, and used consts for fixed values. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
107b7c7
to
5a72ed3
Compare
👍 updated; addressed the comments (❤️) |
Dusting off some old branches 😂
- A picture of a cute animal (not mandatory but encouraged)