kubeletplugin: join the socket cleanup error, not the primary one twice
Both cleanup paths in endpoint.go passed the primary error to errors.Join twice instead of joining removeErr, so a failed socket removal was thrown away. In listen that is visible to a driver: the error travels through startGRPCServer to kubeletplugin.Start, and when the stale-socket removal also fails it reads as the listen error printed twice, without the removal failure that explains why the bind could not happen. In unixListener.Close it is latent. The listener normally closes cleanly, which made the call errors.Join(nil, nil), and that is nil, so Close reported success with the socket still on disk. Nothing observes it today, because the listener is handed to grpc.Server.Serve, which drops the error from closing it, and unixListener is unexported. It is fixed because the code does not do what it says. The test covers Close only: listen removes the socket before binding and returns early if that fails, so its second removal cannot be made to fail without changing the code.
T
thc1006 committed
3cbbdf254a765d39bd292e93655596440d885de6
Parent: a818af1