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

CHE-5871: refactor DockerMachineStarter #5931

Merged
merged 1 commit into from
Aug 9, 2017

Conversation

garagatyi
Copy link

What does this PR do?

Refactor DockerMachineStarter to clean it up and reduce its responsibilities.
Move container configuration applying to InfrastructureProvisioners.
Move classes to different packages to create some structure and reduce classes mess in a single package.
Uncomment some commented tests.

What issues does this PR fix or reference?

Fixes #5871

Changelog

Refactor DockerMachineStarter to clean it up

@garagatyi garagatyi added the target/branch Indicates that a PR will be merged into a branch other than master. label Aug 8, 2017
*/
@Singleton
public class DockerApiHostEnvVariableProvisioner implements ConfigurationProvisioner {
private final Pair<String, String> result;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you don't need Pair here. You can save value of the following expression
format("tcp://%s:%s", dockerConnectorConfiguration.getDockerHost(), dockerDaemonUri.getPort())
and then just use DockerConnectorConfiguration.DOCKER_HOST_PROPERTY constant as name of env variable.

Copy link
Author

Choose a reason for hiding this comment

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

Nice catch, ty.

if (isNullOrEmpty(extraHosts)) {
this.extraHosts = Collections.emptyList();
} else {
this.extraHosts = Arrays.stream(extraHosts.split(","))
Copy link
Contributor

@voievodin voievodin Aug 8, 2017

Choose a reason for hiding this comment

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

i'd better inject an array of strings, so there is no need to do the split, AFAIK StringArrayConverter will do it for you.

Copy link
Author

Choose a reason for hiding this comment

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

Looks like StringArrayConverter requires space between values. WDYT?

Copy link
Contributor

@voievodin voievodin Aug 8, 2017

Choose a reason for hiding this comment

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

It requires zero or many spaces, thus it should be fine

Copy link
Author

Choose a reason for hiding this comment

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

My bad, you are right! I'll replace splitting.

@codenvy-ci
Copy link

Build # 3302 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/3302/ to view the results.

@codenvy-ci
Copy link

Refactor DockerMachineStarter to clean it up and reduce
its responsibilities. Move container configuration applying
to InfrastructureProvisioners.
Move classes to different packages to create some structure and
reduce classes mess in a single package.
Uncomment some commented tests.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
@garagatyi garagatyi merged commit 8be2f0e into eclipse-che:spi Aug 9, 2017
@garagatyi garagatyi deleted the dockertests branch August 9, 2017 08:35
@codenvy-ci
Copy link

@skabashnyuk skabashnyuk added this to the 6.0.0-M1 milestone Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/branch Indicates that a PR will be merged into a branch other than master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants