mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 23:19:26 +00:00
kubelet: podresources: rename variable
on unix, the podresources endpoint is a unix domain socket; on windows, the podresources endpoint is a named pipe; rename the variables to convey this fact. No changes in behavior. Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
@@ -2777,7 +2777,7 @@ func (kl *Kubelet) ListenAndServeReadOnly(address net.IP, port uint) {
|
||||
|
||||
// ListenAndServePodResources runs the kubelet podresources grpc service
|
||||
func (kl *Kubelet) ListenAndServePodResources() {
|
||||
socket, err := util.LocalEndpoint(kl.getPodResourcesDir(), podresources.Socket)
|
||||
endpoint, err := util.LocalEndpoint(kl.getPodResourcesDir(), podresources.Socket)
|
||||
if err != nil {
|
||||
klog.V(2).InfoS("Failed to get local endpoint for PodResources endpoint", "err", err)
|
||||
return
|
||||
@@ -2791,7 +2791,7 @@ func (kl *Kubelet) ListenAndServePodResources() {
|
||||
DynamicResources: kl.containerManager,
|
||||
}
|
||||
|
||||
server.ListenAndServePodResources(socket, providers)
|
||||
server.ListenAndServePodResources(endpoint, providers)
|
||||
}
|
||||
|
||||
// Delete the eligible dead container instances in a pod. Depending on the configuration, the latest dead containers may be kept around.
|
||||
|
@@ -218,13 +218,13 @@ type PodResourcesProviders struct {
|
||||
}
|
||||
|
||||
// ListenAndServePodResources initializes a gRPC server to serve the PodResources service
|
||||
func ListenAndServePodResources(socket string, providers podresources.PodResourcesProviders) {
|
||||
func ListenAndServePodResources(endpoint string, providers podresources.PodResourcesProviders) {
|
||||
server := grpc.NewServer(podresourcesgrpc.WithRateLimiter(podresourcesgrpc.DefaultQPS, podresourcesgrpc.DefaultBurstTokens))
|
||||
|
||||
podresourcesapiv1alpha1.RegisterPodResourcesListerServer(server, podresources.NewV1alpha1PodResourcesServer(providers))
|
||||
podresourcesapi.RegisterPodResourcesListerServer(server, podresources.NewV1PodResourcesServer(providers))
|
||||
|
||||
l, err := util.CreateListener(socket)
|
||||
l, err := util.CreateListener(endpoint)
|
||||
if err != nil {
|
||||
klog.ErrorS(err, "Failed to create listener for podResources endpoint")
|
||||
os.Exit(1)
|
||||
|
Reference in New Issue
Block a user