integration-cli: remove deprecated dockerCmd and waitRun utilities#46088
integration-cli: remove deprecated dockerCmd and waitRun utilities#46088thaJeztah merged 42 commits intomoby:masterfrom
dockerCmd and waitRun utilities#46088Conversation
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 waitRundockerCmd and waitRun utilities
3d26f90 to
8516a9f
Compare
8516a9f to
0748c6f
Compare
0748c6f to
07dab91
Compare
|
Unrelated, but interesting failure; |
07dab91 to
107b7c7
Compare
rumpl
left a comment
There was a problem hiding this comment.
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 |
|
|
||
| // 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.
Why use .Combined() here
(see next comment)
There was a problem hiding this comment.
(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.
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.
|
|
||
| // 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.
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.
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.
This can probably be a .Stdout(), right? docker commit prints to stdout if everything went okay (which seems to be expected here)
| 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.
This is much more readable :)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also adding some consts for fixed values. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also renaming vars that collided with package-level vars and using consts for fixed values. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also adding some consts for fixed values. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also fixed some variables that shadowed package-level vars, and used consts for fixed values. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
107b7c7 to
5a72ed3
Compare
|
👍 updated; addressed the comments (❤️) |
Dusting off some old branches 😂
- A picture of a cute animal (not mandatory but encouraged)