Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add check for compatible Docker OS type #1780

Merged
merged 5 commits into from Aug 25, 2019
Merged

add check for compatible Docker OS type #1780

merged 5 commits into from Aug 25, 2019

Conversation

jetersen
Copy link
Contributor

@jetersen jetersen commented Aug 24, 2019

as Windows containers are not supported at the moment

resolves #1765

works out great 馃檶

aug. 24, 2019 12:26:02 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$1
INFO: Loaded org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
aug. 24, 2019 12:26:02 PM org.testcontainers.dockerclient.DockerClientProviderStrategy getClientForConfig
INFO: Will use 'okhttp' transport
aug. 24, 2019 12:26:03 PM org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy test
INFO: Accessing docker with local Npipe socket (npipe:////./pipe/docker_engine)
aug. 24, 2019 12:26:03 PM org.testcontainers.dockerclient.DockerClientProviderStrategy getClientForConfig
INFO: Will use 'okhttp' transport
aug. 24, 2019 12:26:03 PM org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy test
INFO: Accessing docker with local Npipe socket (npipe:////./pipe/docker_engine)
aug. 24, 2019 12:26:03 PM org.testcontainers.dockerclient.DockerClientProviderStrategy getClientForConfig
INFO: Will use 'okhttp' transport
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerMachineClientProviderStrategy test
INFO: Found docker-machine, and will use machine named 
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE: Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE:     NpipeSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Windows containers are currently not supported)
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE:     NpipeSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Windows containers are currently not supported)
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE:     WindowsClientProviderStrategy: failed with exception TimeoutException (Timeout waiting for result with exception). Root cause ConnectException (Connection refused: connect)
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE:     DockerMachineClientProviderStrategy: failed with exception InvalidConfigurationException (Exception when executing docker-machine status )
aug. 24, 2019 12:26:09 PM org.testcontainers.dockerclient.DockerClientProviderStrategy lambda$getFirstValidStrategy$3
SEVERE: As no valid configuration was found, execution cannot continue

as Windows containers are not supported at the moment
Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things here:

  1. please check for "linux" instead of "not windows", just in case
  2. I would make it more generic, for every strategy. e.g. check for OSType after calling .test() in DockerClientProviderStrategy

@bsideup bsideup added this to the next milestone Aug 24, 2019
@jetersen
Copy link
Contributor Author

jetersen commented Aug 24, 2019

@bsideup checking for linux could mean if they ever introduced a hybrid mode we would have to adapt. Whereas by checking for windows could keep the same check.

@bsideup
Copy link
Member

bsideup commented Aug 24, 2019

@Casz we would have to adapt if they introduce macOS or ARM containers too, so I would rather stick to what we explicitly support

@jetersen jetersen changed the title add container OSType check for Windows strategies add check for compatible Docker OS type Aug 24, 2019
@jetersen
Copy link
Contributor Author

This will unblock something like this
https://github.com/casz/vault-java-driver/tree/chore/singleTestPackage
https://github.com/casz/vault-java-driver/runs/202447075

Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good, pinging @rnorth and @kiview to check the wording, just in case

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good to me, thank you @Casz.

@rnorth rnorth merged commit 8894dae into testcontainers:master Aug 25, 2019
@jetersen
Copy link
Contributor Author

Thank you 馃檶

@jetersen jetersen deleted the fix/detectWindowsOSType branch August 25, 2019 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Would be helpful to have a way to test OSType for your assumeTrue.
3 participants