-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
pull client API version negotiation out of the CLI and into the client #32779
Conversation
@rremer build error
|
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.
Overall I think this is good, so design LGTM
cli/command/cli.go
Outdated
ping, err := cli.client.Ping(context.Background()) | ||
if err != nil { | ||
return err | ||
} |
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.
We don't want to fail here if there is an error. A user might just be running with --help
to figure out how to specify the docker host.
This should return nil
, and I guess could use a comment about why.
client/client.go
Outdated
// If no version specified, negotiate with the server | ||
if v == "" { | ||
cli.DowngradeClientVersion() | ||
} |
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.
There are two distinct use cases for this function so I don't think it makes sense to group these together.
DockerCLI.Initialize()
should call DowngradeClientVersionPing()
directly, and leave this functions as it was.
We might be able to just delete UpdateClientVersion()
, I don't think it's called from anywhere else.
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.
Indeed there are no other references to UpdateClientVersion that I can find, however removing it would:
- potentially break existing consumers of the client library
- put update logic into the new negotiate function (although, it is just updating a field)
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.
We don't make any promises about not breaking the API on client/
it's not being released as a versioned package.
client/client.go
Outdated
func (cli *Client) DowngradeClientVersion() { | ||
ping, _ := cli.Ping(context.Background()) | ||
cli.DowngradeClientVersionPing(ping) | ||
} |
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.
I think this needs a more appropriate name, It's not necessarily downgrading, it might just be verifying the version is correct. It's also the "APIVersion", not the client version. Maybe NegotiateAPIVersion()
?
client/client.go
Outdated
|
||
// DowngradeClientVersionPing downgrades the version string associated with this | ||
// instance of the Client to match the latest version the server supports | ||
func (cli *Client) DowngradeClientVersionPing(p types.Ping) { |
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.
Same comment about the function name, how about UpdateAPIVersionFromPing()
?
The check for if !cli.manualOverride {...}
needs to move here. It should be the first line in the function I think:
if cli.manualOverride {
return
}
client/client_test.go
Outdated
|
||
// test downgrade | ||
client.DowngradeClientVersionPing(ping) | ||
if client.version != expected { |
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.
assert.Equal(t, expected, client.version)
(same with the other assertions)
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.
I was trying to use the same format as the rest of the tests in this suite. If I understood your suggestion, we want to use an assertion framework, so I reworked the tests here to use the same assertion library found in other packages here. I kept this in a separate commit, since it's unrelated cleanup.
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.
Yes, we are slowly migrating everything to testify assertions.
Thanks for the feedback, @dnephin ! |
cli/command/cli.go
Outdated
@@ -171,6 +170,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions) error { | |||
|
|||
opts.Common.TLSOptions.Passphrase = passwd | |||
cli.client, err = NewAPIClientFromFlags(opts.Common, cli.configFile) | |||
cli.client.NegotiateAPIVersion() |
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 doesn't seem like the right place for this. We also don't want to call ping again. I think this line needs to be removed.
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, I misunderstood the request to move this to "Initialize". I'm guessing we meant "When we remove UpdateClientVersion, then NegotiateAPIVersion should just take its place".
cli/command/cli.go
Outdated
} | ||
|
||
cli.client.UpdateClientVersion("") |
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 should be `NegotiateAPIVersionPing(ping)
0cb5794
to
e298205
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
This one needs a rebase because the CLI has been removed from this repo (though the client still exists here). |
e298205
to
fe396be
Compare
Woah, I leave the country for a bit and the whole project disappears! I've rebased, and once it's merged/released we can update the cli to take advantage of NegotiateAPIVersion() @cpuguy83 Incidentally, since the project restructure, moby/moby:master has a failing test in client_test.go: TestClientRedirect, happy to investigate that, just wanted to point out that it's unrelated to this change. |
client/client.go
Outdated
// NegotiateAPIVersion updates the version string associated with this | ||
// instance of the Client to match the latest version the server supports | ||
func (cli *Client) NegotiateAPIVersion() { | ||
ping, _ := cli.Ping(context.Background()) |
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.
I guess context should be an argument to this function. the caller can decide if they have a context they'd like to re-use, or if they want to start a new background context.
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.
Done.
174200d
to
75b5de5
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
It appears that node azure-windows-rs1-5 may require daemon/logger/adapter_test.go:137 to be more than 10 milliseconds. Slow shared tenant windows vms aside, we probably don't want to consider log reading to be a failure if it takes more than 10 milliseconds . Maybe >1s is a failure? |
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
And yes, that timeout should be increased. I've seen it fail a few times on windowsRS1
client/client_test.go
Outdated
} | ||
|
||
// MapToEnv takes a map of environment variables and sets them | ||
func MapToEnv(env map[string]string) { |
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 should not be exported.
client/client_test.go
Outdated
} | ||
} | ||
|
||
// EnvToMap returns a map of environment variables | ||
func EnvToMap() map[string]string { |
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 should not be exported.
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.
sure, done.
Signed-off-by: Royce Remer <royceremer@gmail.com>
75b5de5
to
5f1d94e
Compare
|
||
// NegotiateAPIVersionPing updates the version string associated with this | ||
// instance of the Client to match the latest version the server supports | ||
func (cli *Client) NegotiateAPIVersionPing(p types.Ping) { |
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.
Does this need to be exposed on the interface?
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.
I believe it does. This is what we'll call from docker/cli
because we already have a Ping
object, which we need to store HasExperimental
and OSType
.
The other one is a "convenience" for other consumers of this library.
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
Squashed commit of the following: commit ed225df Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <3846masahiro+git@gmail.com> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
Squashed commit of the following: commit b677dbc Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:35:30 2017 +0900 Fix golang version commit 43bc363 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:12:42 2017 +0900 Fix shebang for Windows commit ed225df Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <3846masahiro+git@gmail.com> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
Squashed commit of the following: commit b677dbc Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:35:30 2017 +0900 Fix golang version commit 43bc363 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:12:42 2017 +0900 Fix shebang for Windows commit ed225df Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <3846masahiro+git@gmail.com> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
Squashed commit of the following: commit b677dbc Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:35:30 2017 +0900 Fix golang version commit 43bc363 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sat Oct 28 11:12:42 2017 +0900 Fix shebang for Windows commit ed225df Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:29:39 2017 +0900 Fix CI commit 94a625d Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:49 2017 +0900 Fix windows installer commit 0bea8fb Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Sep 8 10:26:20 2017 +0900 Fix README for Windows installer commit 237a4a7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 19:11:19 2017 +0900 Fix build for Windows commit bc508d7 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:59:16 2017 +0900 Fix to set API version (moby/moby#32779) commit 442be2f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:03:01 2017 +0900 Update README for Windows commit e83b2ed Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:01:01 2017 +0900 Add installer for Windows commit 776b931 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 18:00:38 2017 +0900 Build for Windows commit bc01aef Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:43 2017 +0900 Fix `run.go` for Windows commit 63b9490 Merge: a72237f 0fea7e2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:43:01 2017 +0900 Merge tag '0.1.0' of https://github.com/bfirsh/whalebrew into support-windows commit a72237f Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:26:29 2017 +0900 Fix `ForceInstall` for windows commit de458d9 Merge: 03d00bf e7d0792 Author: 3846masa <3846masahiro+git@gmail.com> Date: Thu Sep 7 17:22:41 2017 +0900 Merge tag '0.0.5' into support-windows commit 03d00bf Author: 3846masa <3846masahiro+git@gmail.com> Date: Tue Feb 14 00:01:52 2017 +0900 Fix batch file's shebang commit 21bcf14 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 22:19:25 2017 +0900 Fix .travis.yml for forked project commit a0e486c Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:59:19 2017 +0900 Add appveyor.yml commit fe06f35 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:34:46 2017 +0900 MakePackagePath commit bc12aa0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 21:23:31 2017 +0900 Rewrite test commit 7453d37 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 20:28:33 2017 +0900 `path.Join` -> `filepath.Join` commit 4ded1a2 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:53:51 2017 +0900 LF -> CRLF in batch file commit 8078165 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:34:08 2017 +0900 Fix edit for Windows commit 8746496 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:15:55 2017 +0900 Fix run for windows commit bb652d4 Merge: 8a6d783 e7e6427 Author: 3846masa <3846masahiro+git@gmail.com> Date: Mon Feb 13 16:08:42 2017 +0900 Merge v0.0.4 Merge remote-tracking branch 'origin/master' into support-windows commit 8a6d783 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 21:11:59 2017 +0900 Support to run and return status code on Windows commit ce3d298 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:58:21 2017 +0900 Revert "syscall -> exec (for working on windows)" This reverts commit 276a9cd. commit ffbdd15 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:50:08 2017 +0900 Add batch file support (for working on windows) commit cdc5a05 Author: 3846masa <3846masahiro+git@gmail.com> Date: Sun Feb 5 20:34:30 2017 +0900 Revert "Add batch file support (for working on windows)" This reverts commit aba79b0. commit 10e10a0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Fri Feb 3 00:53:23 2017 +0900 Revert "Fix checking args (for working on windows)" This reverts commit 926f422. commit 74db526 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:14:59 2017 +0900 Fix default WHALEBREW_INSTALL_PATH (for working on windows) commit aba79b0 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 03:06:00 2017 +0900 Add batch file support (for working on windows) commit 926f422 Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:45:51 2017 +0900 Fix checking args (for working on windows) commit 276a9cd Author: 3846masa <3846masahiro+git@gmail.com> Date: Wed Feb 1 01:36:56 2017 +0900 syscall -> exec (for working on windows)
- What I did
Added some tests for client version discovery, and moved that logic out of the CLI and into the client.
The drive here is that I was using the go docker client, and had to call UpdateVersion with a string I needed to get from the server. I noticed that the CLI never had to do this, and sure enough there was some server version negotiation going on in the CLI. At this commit, the CLI just implements a normal client, and the client owns the logic for server version negotiation (so folks consuming the client library can enjoy that same functionality).
- How I did it
Added a new conditional statement in client/client.go UpdateClientVersion(str). If the string is empty, it will trigger DowngradeClientVersion() and step into some cut/paste logic that already existed in cli/command/cli.go for pinging the server, grabbing the APIVersion string, and updating that.
- How to verify it
or
The manual/functional verification for the CLI built against this commit:
The test cases cover a few more edges than that:
- Description for the changelog
UpdateClientVersion can auto-downgrade to the server APIVersion
- A picture of a cute animal (not mandatory but encouraged)