-
Notifications
You must be signed in to change notification settings - Fork 53
Fix double http in the Spark Driver UI Link #347
Conversation
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Signed-off-by: mucahit-kantepe <[email protected]>
Signed-off-by: mucahit-kantepe <[email protected]>
a small code change suggested, then looks good |
Co-authored-by: Ketan Umare <[email protected]> Signed-off-by: Mücahit Kantepe <[email protected]>
Signed-off-by: Mücahit Kantepe <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #347 +/- ##
==========================================
+ Coverage 62.77% 64.08% +1.31%
==========================================
Files 148 148
Lines 12434 10074 -2360
==========================================
- Hits 7805 6456 -1349
+ Misses 4034 3023 -1011
Partials 595 595
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: mucahit-kantepe <[email protected]>
uri := strings.TrimPrefix(sj.Status.DriverInfo.WebUIIngressAddress, "http://") | ||
customInfoMap[sparkDriverUI] = fmt.Sprintf("https://%s", uri) |
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.
To maintain backwards compatibility does it make sense to check for the prefix rather than removing it (noop if it doesn't exist) and then appending it? Maybe something like
uri := sj.Status.DriverInfo.WebUIIngressAddress
if !strings.HasPrefix("https://") {
uri = fmt.Sprintf("https://%s", uri)
}
customInfoMap[sparkDriverUI] = uri
customInfoMap[sparkDriverUI] = fmt.Sprintf("https://%s", sj.Status.DriverInfo.WebUIIngressAddress) | ||
// Older versions of spark-operator does not append http:// but newer versions do. | ||
uri := strings.TrimPrefix(sj.Status.DriverInfo.WebUIIngressAddress, "http://") | ||
customInfoMap[sparkDriverUI] = fmt.Sprintf("https://%s", uri) |
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.
We shouldn't assume SSL all the time. Does spark enforce ssl?
uri := sj.Status.DriverInfo.WebUIIngressAddress
if !strings.HasPrefix("https://") && !strings.HasPrefix("http://") {
uri = fmt.Sprintf("https://%s", uri)
}
customInfoMap[sparkDriverUI] = uri
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 agree, so we should just pass the WebUIIngressAddress
value along?
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.
@mucahitkantepe yes, and then if it does not contain https
or http
we can prepend with https
as Haytham suggests.
work completed in #389 |
Fixes flyteorg/flyte#3623
Spark operator code: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/5f2efd4ff97e7c0bfdb726a066118d3401576730/pkg/controller/sparkapplication/sparkui.go#L57
This change solves the problem by keeping Flyte compatible with older version of Spark Operator.
Another, simpler implentation is to just pass whatever spark operator gives. Browsers will add https automatically?