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
Adds secure field to url list table ouput and json output. #2817
Adds secure field to url list table ouput and json output. #2817
Conversation
|
||
// are there changes between local and cluster states? | ||
outOfSync := false | ||
for _, i := range localUrls { | ||
var present bool | ||
for _, u := range urls.Items { | ||
if i.Name == u.Name { | ||
fmt.Fprintln(tabWriterURL, u.Name, "\t", url.GetURLString(url.GetProtocol(routev1.Route{}, u), "", u.Spec.Rules[0].Host), "\t", u.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].Backend.ServicePort.IntVal) | ||
fmt.Fprintln(tabWriterURL, u.Name, "\t", url.GetURLString(url.GetProtocol(routev1.Route{}, u), "", u.Spec.Rules[0].Host), "\t", u.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].Backend.ServicePort.IntVal, "\t", u.Spec.TLS != nil) |
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.
can we make this more readable? just top of my head maybe extract url.GetURLString(url.GetProtocol(routev1.Route{}, u), "", u.Spec.Rules[0].Host)
into a helper?
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.
url.GetURLString(url.GetProtocol(routev1.Route{}, u), "", u.Spec.Rules[0].Host)
But url.GetURLString() is already a helper function.
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 am ok if you feel we cannot make this more clean.
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 tried certain things but it was making things a bit complicated and weird for me.
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
For a URL that's not set to be $ odo url list
Found the following URLs for component nodejs-nodejs-ex-zdgz in application app:
NAME STATE URL PORT SECURE
url1 Pushed http://url1-app-myproject.apps-crc.testing 8080 false
$ odo url list -o json
{
"kind": "List",
"apiVersion": "odo.openshift.io/v1alpha1",
"metadata": {},
"items": [
{
"kind": "url",
"apiVersion": "odo.openshift.io/v1alpha1",
"metadata": {
"name": "url1",
"creationTimestamp": null
},
"spec": {
"host": "url1-app-myproject.apps-crc.testing",
"protocol": "http",
"port": 8080
},
"status": {
"state": "Pushed"
}
}
]
} |
We are using |
I'd vote to keep it. Explicit is better than implicit. 😉 Let's wait for others to chime in. 😄 |
Added back. Please have a look again :) |
Test looks good to me. I won't mind if you guys finalize the concern and apply lgtm label. |
Codecov Report
@@ Coverage Diff @@
## master #2817 +/- ##
==========================================
- Coverage 43.70% 43.68% -0.03%
==========================================
Files 97 97
Lines 8783 8801 +18
==========================================
+ Hits 3839 3845 +6
- Misses 4580 4593 +13
+ Partials 364 363 -1
Continue to review full report at Codecov.
|
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.
Functionality wise works for me. Code looks good. Thanks for addressing the false
case @mik-dass 👍
/lgtm
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
/kind feature
What does does this PR do / why we need it:
Adds information about the url being a secure one or not in
odo url list
normal and json output.Which issue(s) this PR fixes:
Fixes #2775
How to test changes / Special notes to the reviewer:
odo url list
and also json version of it.odo url list
and also json version of it.The outputs should contain information about the url being a secure one or not.