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
support fieldSelector spec.hostNetwork #110477
support fieldSelector spec.hostNetwork #110477
Conversation
Hi @halfcrazy. 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. |
/sig api-machinery |
I find a workaround here #88530 (comment). /cc @liggitt |
/sig node |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
pkg/apis/core/v1/conversion.go
Outdated
@@ -41,11 +41,14 @@ func addConversionFuncs(scheme *runtime.Scheme) error { | |||
"spec.restartPolicy", | |||
"spec.schedulerName", | |||
"spec.serviceAccountName", | |||
"spec.securityContext.hostNetwork", |
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 understand - this is not a real field in v1. It's just spec.hostNetwork
. The internal name doesn't matter.
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.
done
pkg/registry/core/pod/strategy.go
Outdated
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName | ||
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy) | ||
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName) | ||
podSpecificFieldsSet["spec.serviceAccountName"] = string(pod.Spec.ServiceAccountName) | ||
if pod.Spec.SecurityContext != nil { | ||
podSpecificFieldsSet["spec.securityContext.hostNetwork"] = strconv.FormatBool(pod.Spec.SecurityContext.HostNetwork) |
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.
Just spec.hostNetwork
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.
done
Pinging on this one. Open questions prevent it from being accepted yet. |
Update |
74d2da4
to
1d49157
Compare
/retest |
/cc @wojtek-t it will be good to understand if this present an scalability problem and the net value is worth it |
/retest |
Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
d6be85a
to
7fb88ee
Compare
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!
/lgtm
/approve
LGTM label has been added. Git tree hash: d580bec3ec5c932a9f19dc835f71916aab81ebd0
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: halfcrazy, thockin 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add support for pod hostNetwork field selector, it may helpful for the network operator to filter pod.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: