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
Add exposed ports from images without exposed port #1467
Add exposed ports from images without exposed port #1467
Conversation
Signed-off-by: Javier López Barba <javier@okteto.com>
Codecov Report
@@ Coverage Diff @@
## master #1467 +/- ##
==========================================
- Coverage 36.52% 36.28% -0.25%
==========================================
Files 80 80
Lines 7605 7661 +56
==========================================
+ Hits 2778 2780 +2
- Misses 4477 4531 +54
Partials 350 350
Continue to review full report at Codecov.
|
pkg/registry/registry.go
Outdated
|
||
func GetHiddenExposePorts(image string) []int32 { | ||
exposedPorts := make([]int32, 0) | ||
c, err := NewRegistryClient("https://registry.hub.docker.com", "", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the image is not in docker hub? (e.g. in our own)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now it will only inspect docker hub public images. I think this will cover most of the compose files. When using their own image the user usually set the ports in the expose field. This port injection is costly, so it is good to perform it as few times as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work with images with these formats?
- docker.io/bitnami/mongodb
- mongodb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New commits adds support for public images from other repositories. It also adds support for private images on our own registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work with both formats. It will have issues when the image is a official one and adds the registry. For example, docker.io/mongo
.
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba javier@okteto.com
Fixes: When you upload a docker-compose with a service without exposed ports, none of the ports are available in the cluster
Proposed changes