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

added support for multiple-compose files #312

Merged
merged 1 commit into from
Jan 3, 2017

Conversation

procrypt
Copy link
Contributor

@procrypt procrypt commented Nov 25, 2016

Fix #275

$ kompose -f docker-compose.yml,docker-guestbook.yml convert
INFO[0000] file "redis-master-service.json" created     
INFO[0000] file "redis-slave-service.json" created      
INFO[0000] file "redis-service.json" created            
INFO[0000] file "web-service.json" created              
INFO[0000] file "frontend-service.json" created         
INFO[0000] file "redis-master-deployment.json" created  
INFO[0000] file "redis-slave-deployment.json" created   
INFO[0000] file "redis-deployment.json" created         
INFO[0000] file "web-deployment.json" created           
INFO[0000] file "frontend-deployment.json" created 

cc @kadel @surajssd

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 25, 2016
@kadel
Copy link
Member

kadel commented Nov 25, 2016

I'm not sure if comma separated list is right here :-(
With docker-compose it looks like this - docker-compose -f docker-compose.yml -f docker-guestbook.yml up
I think that we should do it in the same way as docker-compose does it.

@cdrage how would this work with #304 ?
Comma separated or multiple -f arguments?

@cdrage
Copy link
Member

cdrage commented Nov 25, 2016

@kadel would be easy to implement via #304 once it's merged. But yes, multiple -f arguments would work with it.

@kadel
Copy link
Member

kadel commented Nov 28, 2016

Lets wait for #304. Thank we can revisit this.

@sebgoa sebgoa added this to the v0.3 release milestone Nov 28, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 45.768% when pulling 68a3361 on procrypt:multiple_files into 0370d66 on kubernetes-incubator:master.

@surajssd
Copy link
Member

surajssd commented Dec 28, 2016

@procrypt unit tests, docs needed as well!

Also I thought we are trying to implement this the docker-compose cli way which is

docker-compose -f foo.yml -f bar.yml up

in our case

kompose -f foo.yml -f bar.yml up

as opposed to

kompose -f foo.yml,bar.yml up

@@ -103,6 +103,7 @@ convert::expect_success "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bun
convert::expect_success_and_warning "kompose --bundle $KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/docker-voting-bundle.dsb convert --stdout" "$KOMPOSE_ROOT/script/test/fixtures/bundles/dsb/output-k8s.json" "Service cannot be created because of missing port."

######
<<<<<<< 73418310ac1e607b41d0af2588ed7a808a3c85fa
Copy link
Member

Choose a reason for hiding this comment

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

remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed this by mistake.

redis:
image: redis:3.0
ports:
- "6379"
Copy link
Member

Choose a reason for hiding this comment

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

a real world example where things get over-written will make more sense as opposed to mixing two apps.

Copy link
Member

Choose a reason for hiding this comment

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

things as in same parameters like env vars from 1st docker-compose file get over-written in second!

@procrypt procrypt force-pushed the multiple_files branch 2 times, most recently from 1d3b7d4 to 1ff9136 Compare December 30, 2016 08:13
@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 1ff9136 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 1ff9136 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@procrypt
Copy link
Contributor Author

@surajssd @containscafeine I have updated the PR. Please review

$ kompose -f docker-compose.yml -f docker-guestbook.yml convert 
INFO[0000] file "frontend-service.json" created         
INFO[0000] file "mlbparks-service.json" created         
INFO[0000] file "mongodb-service.json" created          
INFO[0000] file "redis-master-service.json" created     
INFO[0000] file "redis-slave-service.json" created      
INFO[0000] file "frontend-deployment.json" created      
INFO[0000] file "mlbparks-deployment.json" created      
INFO[0000] file "mongodb-deployment.json" created       
INFO[0000] file "mongodb-claim0-persistentvolumeclaim.json" created 
INFO[0000] file "redis-master-deployment.json" created  
INFO[0000] file "redis-slave-deployment.json" created 
$ kompose -f docker-compose.yml -f docker-guestbook.yml convert 
INFO[0000] file "mlbparks-service.json" created         
INFO[0000] file "frontend-service.json" created         
INFO[0000] file "mongodb-service.json" created          
INFO[0000] file "redis-master-service.json" created     
INFO[0000] file "redis-slave-service.json" created      
INFO[0000] file "frontend-deployment.json" created      
INFO[0000] file "mlbparks-deployment.json" created      
INFO[0000] file "mongodb-deployment.json" created       
INFO[0000] file "mongodb-claim0-persistentvolumeclaim.json" created 
INFO[0000] file "redis-master-deployment.json" created  
INFO[0000] file "redis-slave-deployment.json" created 

The test are failing for this particular feature because the artifacts created are not in any particular order. When we run the kompose convert command sometimes mlbparks-service.json will be crated first and sometimes frontend-service.jsonand this makes it difficult to match the output in the tests for this feature. We need to think of a different testing strategy to test this rather than matching the output.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling f91837e on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@surajssd
Copy link
Member

surajssd commented Jan 2, 2017

@procrypt even if the order is upside down, it should not cause any problems, because that is what happens for other conversion also, the order may not be same and still jq does the matching.

@procrypt
Copy link
Contributor Author

procrypt commented Jan 2, 2017

@surajssd Thanks for the explanation, I'll recheck my work on the tests.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 04a2811 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@procrypt procrypt force-pushed the multiple_files branch 2 times, most recently from f097abe to 8e7bb17 Compare January 3, 2017 04:50
@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 8e7bb17 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 8e7bb17 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.8%) to 48.38% when pulling 07fbe01 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@procrypt procrypt force-pushed the multiple_files branch 2 times, most recently from 49efcdd to 8ea7c97 Compare January 3, 2017 05:39
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 46.617% when pulling 8ea7c97 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 46.617% when pulling 8ea7c97 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@surajssd
Copy link
Member

surajssd commented Jan 3, 2017

@procrypt one last bit, add info about this awesome fetaure to docs! Rest LGTM

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 46.617% when pulling e8af6f1 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 46.617% when pulling de2b448 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 46.617% when pulling a5a3805 on procrypt:multiple_files into 9c3fdaa on kubernetes-incubator:master.

@surajssd surajssd merged commit b059c44 into kubernetes:master Jan 3, 2017
@surajssd
Copy link
Member

surajssd commented Jan 3, 2017

@procrypt thanks for awesome work, code + tests + docs 👍 🎉

@procrypt
Copy link
Contributor Author

procrypt commented Jan 3, 2017

@surajssd Thank you all your help 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants