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:
Francesco Romani
2023-03-08 19:25:42 +01:00
parent 60be214af1
commit 195fc2f516
2 changed files with 4 additions and 4 deletions

View File

@@ -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.

View File

@@ -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)