-
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
service list cmd: display target port and name #6879
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Hi @prasadkatti. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: prasadkatti The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
eab12d9
to
720355b
Compare
Can one of the admins verify this patch? |
/assign @tstromberg |
720355b
to
9f41fd4
Compare
@prasadkatti can you please put before and after output in the PR description ? |
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.
@prasadkatti Thank you for this PR. I left a few comments.
pkg/minikube/service/service.go
Outdated
@@ -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 comment
The 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 name/port
if name is available, if not only port
.
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 ! 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 comment
The 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.
serviceURLs := strings.Join(serviceURL.URLs, "\n") | ||
|
||
// if we are running Docker on OSX we empty the internal service URLs | ||
if runtime.GOOS == "darwin" && cfg.Driver == oci.Docker { | ||
serviceURLs = "" | ||
} | ||
|
||
data = append(data, []string{serviceURL.Namespace, serviceURL.Name, "", serviceURLs}) | ||
data = append(data, []string{serviceURL.Namespace, serviceURL.Name, servicePortNames, serviceURLs}) |
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 for minikube service <service-name>
, so if we are printing name || port
there, the same should be done here
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.
Both minikube service list
and minikube service <service-name>
eventually call printURLsForService
which is where I am making these changes. So the results should be consistent. Maybe the variable name needs to change?
@prasadkatti welcome to the community of minikbue contributors :) happy to see your contribution ! |
@medyagh - Thanks. I am hoping to learn more about minikube/kubernetes through this process. I have added the before/after images that you requested to the issue description. The column header does need to change in my opinion, but I am not sure what I should change it to. Please provide suggestions. |
Also, some tests are failing. I haven't quite figured that out yet. Are they failing because of these changes? I will need some help with that. |
@prasadkatti unit tests are failing please make sure to run make test locally to see the error or checkout the https://github.com/kubernetes/minikube/pull/6879/checks?check_run_id=486144522 seems like we need to update our unit test
|
Codecov Report
@@ Coverage Diff @@
## master #6879 +/- ##
=========================================
- Coverage 38.3% 37.8% -0.51%
=========================================
Files 142 142
Lines 8740 8875 +135
=========================================
+ Hits 3348 3355 +7
- Misses 4971 5093 +122
- Partials 421 427 +6
|
@medyagh - I have fixed the unit tests. I had to update the tests like you suspected. |
Should I remove the |
Thanks @prasadkatti I will review this tommorow |
@medyagh - reminder to take a look at this PR when you get a chance |
Any update on this? Do I need to fix anything else here? |
/ok-to-test |
@prasadkatti thank you for your patience and sorry that took me so long to come back to this PR. |
Error: running mkcmp: exit status 1 |
Thank you very much for this PR, this will improve minikube service command ! |
Populate the target port in
service list
fixes: #6860
Use port name for target port if provided. If not, use 'port'.
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#serviceport-v1-core
This is my first contribution to minikube. I am also fairly new to kubernetes. So please go easy on me. :)
Before
After