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

Fix #986 : Create volumes with proper configuration during "docker:start" #1007

Merged
merged 4 commits into from
Sep 25, 2018

Conversation

rohanKanojia
Copy link
Member

@rohanKanojia rohanKanojia added the WIP Work in Progress label Apr 23, 2018
@codecov
Copy link

codecov bot commented Apr 23, 2018

Codecov Report

Merging #1007 into master will increase coverage by 0.51%.
The diff coverage is 65%.

@@             Coverage Diff              @@
##             master    #1007      +/-   ##
============================================
+ Coverage      51.3%   51.81%   +0.51%     
- Complexity     1429     1441      +12     
============================================
  Files           150      150              
  Lines          7755     7775      +20     
  Branches       1151     1156       +5     
============================================
+ Hits           3979     4029      +50     
+ Misses         3384     3350      -34     
- Partials        392      396       +4
Impacted Files Coverage Δ Complexity Δ
...c/main/java/io/fabric8/maven/docker/StartMojo.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...va/io/fabric8/maven/docker/service/RunService.java 51.07% <81.25%> (+2.22%) 25 <3> (+3) ⬆️
.../io/fabric8/maven/docker/service/WatchService.java 3.79% <0%> (+3.79%) 1% <0%> (+1%) ⬆️
...a/io/fabric8/maven/docker/service/WaitService.java 4.42% <0%> (+4.42%) 1% <0%> (+1%) ⬆️
...o/fabric8/maven/docker/service/ArchiveService.java 26.66% <0%> (+26.66%) 1% <0%> (+1%) ⬆️
...va/io/fabric8/maven/docker/service/ServiceHub.java 36.58% <0%> (+36.58%) 3% <0%> (+3%) ⬆️
...abric8/maven/docker/service/ServiceHubFactory.java 80% <0%> (+80%) 2% <0%> (+2%) ⬆️

Copy link
Collaborator

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Looks good to me, except that we should move the method to the RunService (and some comments on the style, too).

Some test would be awesome, too (which is easier todo when specified in the RunService).

This PR is still marked as WIP. Is this still true ?

@@ -331,6 +336,26 @@ public StartedContainer call() throws Exception {
return imagesWaitingToStart;
}

private void createVolumesAsPerVolumeBinds(ServiceHub hub, List<String> volumeBinds, List<VolumeConfiguration> volumesConfigs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we move this out of the StartMojo into the RunService ? The Mojo should stay as slim as possible.

private void createVolumesAsPerVolumeBinds(ServiceHub hub, List<String> volumeBinds, List<VolumeConfiguration> volumesConfigs)
throws DockerAccessException {
Map<String, Integer> aIndexMap = new HashMap();
for(Integer aIndex = 0; aIndex < volumesConfigs.size(); aIndex++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add braces

if(aVolumeBind.contains(":")) {
aVolumeBind = aVolumeBind.substring(0, aVolumeBind.indexOf(":"));
}
Integer nVolumeConfigIndex = aIndexMap.get(aVolumeBind);
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the difference between an n and a a prefix for your variables names ? tbh, I would avoid that kind of prefixing as we don't do it nowhere else in this code base. It's always good to adapt to a given codestyle instead of introducing ones own (like avoid braces or spaces after for or if). This helps to keep the code consistently readable.

@rohanKanojia rohanKanojia removed the WIP Work in Progress label May 16, 2018
@rohanKanojia rohanKanojia force-pushed the issue986 branch 2 times, most recently from 0e45351 to a770153 Compare May 16, 2018 18:57
@rohanKanojia rohanKanojia force-pushed the issue986 branch 2 times, most recently from d86b78d to 67563cb Compare July 6, 2018 11:43
@rohanKanojia
Copy link
Member Author

@rhuss : Could you please take a look at it again? I've modified it according to your comments :)

@rhuss
Copy link
Collaborator

rhuss commented Jul 31, 2018

thanks, will do ASAP !

@rhuss rhuss force-pushed the issue986 branch 2 times, most recently from 187acea to ca2a8f0 Compare September 25, 2018 12:07
@rhuss
Copy link
Collaborator

rhuss commented Sep 25, 2018

@rohanKanojia Thanks ! Going to merge now ...

@rhuss rhuss merged commit 4481c2f into fabric8io:master Sep 25, 2018
@jmayday
Copy link

jmayday commented Sep 28, 2018

I'm afraid it caused regression:
#1093

@rohanKanojia
Copy link
Member Author

rohanKanojia commented Sep 28, 2018

@jmayday @rhuss : Sorry for causing regression 😞

@jmayday
Copy link

jmayday commented Sep 28, 2018

It's OK, I'm fine with downgrading for now. It just took time to analyze what's going on.

@rohanKanojia
Copy link
Member Author

@jmayday : bdw, Roland fixed this in #1092 . It would be released soon :-)

@rhuss
Copy link
Collaborator

rhuss commented Sep 28, 2018

np, its was a bad reviewer ;-) 'going to release 0.27.1 this evening ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants