-
Notifications
You must be signed in to change notification settings - Fork 150
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: use https protocol in the 'che-incubator/che-code/insiders' editor #1810
Changes from all commits
66fe442
1bbcce6
ae05276
de4d721
0786b84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,13 +131,14 @@ export class MetaYamlToDevfileYaml { | |
devfileEndpoint.attributes['type'] = 'main'; | ||
} | ||
|
||
// if it's secured, remove secure option for now but add extra s on the protocol | ||
// if it's secured, remove 'secure' option for now but change protocol to secure (https or wss) | ||
if (devfileEndpoint.attributes && devfileEndpoint.attributes.secure === true) { | ||
devfileEndpoint.secure = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why we change secure to false when it was set to true. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @l0rd do you happen to remember why it was done that way? I recall that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @amisevsk ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No I don't remember. My guess would be that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Devfile API docs give
but I think (haven't verified) that this field is either ignored in Che or is interpreted as "use https instead of http" (which isn't really appropriate, API-wise). I think the "most correct" solution would be something like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
delete devfileEndpoint.attributes['secure']; | ||
// add extra s | ||
if (devfileEndpoint.attributes.protocol) { | ||
devfileEndpoint.attributes.protocol = `${devfileEndpoint.attributes.protocol}s`; | ||
// switch to secure protocol (https or wss) | ||
const protocol = devfileEndpoint.attributes.protocol; | ||
if (protocol && (protocol === 'http' || protocol === 'ws')) { | ||
devfileEndpoint.attributes.protocol = `${protocol}s`; | ||
} | ||
} | ||
|
||
|
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.
I haven't had time to verify this directly and so I'm not sure it's an actual problem, but does this cause issues when running on Kubernetes? Since these endpoints have
urlRewriteSupported: false
, I believe Che will support them via plain ingresses, and I'm not sure if Che is able to configure TLS there.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.
yeah, good point, I need to check this on minikube
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.
tried to verify on minikube but it looks like Che is not supported on this arch in general:
However, Smoke Test PR check should cover the minikube verification. Adding @dmytro-ndp for PR approval
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.
I got Network Error when tried to start workspace of Eclipse Che Next on minikube which is using external plugin registry with URL https://pr-check-1810-che-plugin-registry.surge.sh/v3 given by @ibuziuk :
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.
BTW: the error
Failed to fetch a devfile from URL: https://pr-check-1810-che-plugin-registry.surge.sh/v3/plugins/che-incubator/che-code/latest/devfile.yaml, reason: Error: Network Error
has reproduced on OpenShift 4.10 as well: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.
@olexii4 @akurinnoy folks, it looks like in general it is not possible to reference external plugin registry from the CR since we would hit CORS on dashboard end, right?
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.
It looks like CORS requests are disabled on PR checks like https://pr-check-1810-che-plugin-registry.surge.sh/v3
@svor do you happen to know if it is expected?
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.
@ibuziuk yes, it is expected. Published content on surge.sh doesn't support CORS requests. I've checked external plugin registry with https://eclipse-che.github.io/che-plugin-registry/main/ and it works good.
@dmytro-ndp you can verify current changes by patching Che CR, here is the image that was built with current changes:
quay.io/vsvydenk/che-plugin-registry:https-pr
You can deploy Che on minikube by
chectl server:deploy --batch --platform minikube --che-operator-cr-patch-yaml patch.yaml
where
patch.yaml
is: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.
I've just tested it on minikube (the workspace has been started, all plugins have been installed):