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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use implicit strategy when docker.host configuration is set #4175

Merged
merged 3 commits into from
Jul 18, 2021

Conversation

rnorth
Copy link
Member

@rnorth rnorth commented Jun 8, 2021

No description provided.

@rnorth rnorth added this to the next milestone Jun 14, 2021
}

// looks for unprefixed env var or unprefixed property
String unprefixedEnvVarOrProperty = getEnvVarOrUserProperty("docker.client.strategy", null);
Copy link
Member

Choose a reason for hiding this comment

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

previous implementation was prioritizing this over TESTCONTAINERS_DOCKER_CLIENT_STRATEGY

Copy link
Member

Choose a reason for hiding this comment

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

BTW I am surprised why the tests are passing :D

Copy link
Member Author

Choose a reason for hiding this comment

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

LOL oops...

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh interesting; I'll add some more checks in the tests, but actually I think this order is better: we currently check env vars before properties anyway.

A. Currently in this PR the check order is:

TESTCONTAINERS_DOCKER_CLIENT_STRATEGY
DOCKER_CLIENT_STRATEGY
docker.client.strategy

B. Whereas previously in this PR it went:

DOCKER_CLIENT_STRATEGY
docker.client.strategy
TESTCONTAINERS_DOCKER_CLIENT_STRATEGY

C. Compared with the last release version:

TESTCONTAINERS_DOCKER_CLIENT_STRATEGY
docker.client.strategy

It would feel weird if we prioritise environment variables over properties in some cases but not this one, so I think this is more correct. A is more compatible with C than B was.

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.

None yet

2 participants