-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
service list cmd: display target port and name #6879
Changes from 1 commit
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ import ( | |
"io" | ||
"net/url" | ||
"os" | ||
"strconv" | ||
"strings" | ||
"text/template" | ||
"time" | ||
|
@@ -196,6 +197,13 @@ func printURLsForService(c typed_core.CoreV1Interface, ip, service, namespace st | |
urls := []string{} | ||
portNames := []string{} | ||
for _, port := range svc.Spec.Ports { | ||
|
||
if port.Name != "" { | ||
m[port.TargetPort.IntVal] = port.Name | ||
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 think the port name is useful by itself. I'd rather change to print 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. I agree ! if needed feel free to change the profile column name, to reflect the name/port 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. Thanks for the review. I have pushed a change to address your feedback. I have added before/after images to issue description. The column name does need to be changed in my opinion. But I am not sure what would be the right name for the column. |
||
} else { | ||
m[port.TargetPort.IntVal] = strconv.Itoa(int(port.Port)) | ||
} | ||
|
||
if port.NodePort > 0 { | ||
var doc bytes.Buffer | ||
err = t.Execute(&doc, struct { | ||
|
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 we print for
minikube service list
must be consistent with what we print forminikube service <service-name>
, so if we are printingname || port
there, the same should be done hereThere 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.
Both
minikube service list
andminikube service <service-name>
eventually callprintURLsForService
which is where I am making these changes. So the results should be consistent. Maybe the variable name needs to change?