-
Notifications
You must be signed in to change notification settings - Fork 39.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
Fix kubectl describe pod
probe host info
#129321
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: astraw99 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 |
@@ -2055,6 +2055,9 @@ func DescribeProbe(probe *corev1.Probe) string { | |||
} else { | |||
url.Host = probe.HTTPGet.Host | |||
} | |||
if url.Host == "" { | |||
url.Host = "localhost" |
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.
Should we use localhost or 127.0.0.1 ? 🤔
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'd prefer not to change it, based on documentation we default it to pod ip:
kubernetes/staging/src/k8s.io/api/core/v1/types.go
Lines 2497 to 2500 in fab7593
// Host name to connect to, defaults to the pod IP. You probably want to set | |
// "Host" in httpHeaders instead. | |
// +optional | |
Host string `json:"host,omitempty" protobuf:"bytes,3,opt,name=host"` |
.tcpSocket.host
below is probably the safest change.
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 about add "$podIP" instead of "localhost" in the kubectl describe pod
output?
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'm going to close this since it's not needed.
/close
@@ -2055,6 +2055,9 @@ func DescribeProbe(probe *corev1.Probe) string { | |||
} else { | |||
url.Host = probe.HTTPGet.Host | |||
} | |||
if url.Host == "" { | |||
url.Host = "localhost" |
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'd prefer not to change it, based on documentation we default it to pod ip:
kubernetes/staging/src/k8s.io/api/core/v1/types.go
Lines 2497 to 2500 in fab7593
// Host name to connect to, defaults to the pod IP. You probably want to set | |
// "Host" in httpHeaders instead. | |
// +optional | |
Host string `json:"host,omitempty" protobuf:"bytes,3,opt,name=host"` |
.tcpSocket.host
below is probably the safest change.
@soltysh: Closed this PR. In response to this:
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-sigs/prow repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Using
kubectl describe po xxx
to show pod probe info, when the probe host is empty, there is no default value showed in the output, like below, so this PR add the default value.Which issue(s) this PR fixes:
Fixes #129320
Does this PR introduce a user-facing change?