Open jstrachan opened 9 years ago
am patching the mvn plugin to allow fabric8.service.protocol
to be used...
Service protocol can only be tcp or UDP AFAIK. This is for the kube proxy to set up port listeners.
On 08:23, Fri, 24 Apr 2015 James Strachan notifications@github.com wrote:
am patching the mvn plugin to allow fabric8.service.protocol to be used...
— Reply to this email directly or view it on GitHub https://github.com/fabric8io/fabric8/issues/3808#issuecomment-95832611.
ah crap! :(
OK maybe we need a @HttpProtocol annotation for the CDI stuff; to pick the most suitable http protocol for injecting URLs?
Perhaps a bit more generic, can imagine ssh, ftp, git, etc all being options? Defaulting to http seems sane though.
On Fri, 24 Apr 2015 at 08:25 James Strachan notifications@github.com wrote:
OK maybe we need a @HttpProtocol annotation for the CDI stuff; to pick the most suitable http protocol for injecting URLs?
— Reply to this email directly or view it on GitHub https://github.com/fabric8io/fabric8/issues/3808#issuecomment-95833277.
Yeah, maybe a @ProtocolFromPort that uses the actual port number of the service to determine 80 = http, 443 = https etc?
If a service exposes ssh and http this could be confusing ;). Maybe we need to use a @HttpProtocol annotation to pick https if possible or http if not for the protocol?
For specific protocols, like ssh, folks can use code>@Protocol("ssh")</code its only for things like http/https that a service may or may not be configured to use https; so if not fall back to http (e.g. for gogs).
I think that we should just add an option to the existing annotation Protocol annotation and if explicitly set, we should attempt a "port to protocol" conversion.
so gogs can be configured to use http or https; we've code that would like to use whichever flavour is being used.
https://github.com/fabric8io/fabric8/blob/master/forge/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/GitUserHelper.java#L44-44
I added @Protocol("http") as otherwise this results in URLs of the form: "tcp://foo.bar" which don't work too well in browsers.
What would be nice is if we know its either http or https then use one of those protocols and pick the right protocol based on the port number (e.g. if 443 then use https otherwise default to http).
I kinda hoped the env vars could expose the protocol; but seems to always be "TCP". e.g.:
Ah - looks like we're not setting the protocol string on the gogs service; lets try that and see if it helps...