From dfe657cfa54503a64702a28763eb98b5aab2ee2a Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 30 Aug 2022 22:18:18 +0000 Subject: [PATCH] Add trailing newline to stats response This was just an annoyance when working with the API from a terminal. Signed-off-by: Brian Goff --- cmd/virtual-kubelet/internal/commands/root/root.go | 10 ---------- node/api/stats.go | 1 + node/nodeutil/controller.go | 4 ++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cmd/virtual-kubelet/internal/commands/root/root.go b/cmd/virtual-kubelet/internal/commands/root/root.go index 2e786d7ef..945515fd6 100644 --- a/cmd/virtual-kubelet/internal/commands/root/root.go +++ b/cmd/virtual-kubelet/internal/commands/root/root.go @@ -117,17 +117,7 @@ func runRootCommand(ctx context.Context, s *provider.Store, c Opts) error { return nil }, -<<<<<<< HEAD - nodeutil.WithClient(clientSet), - setAuth(c.NodeName, apiConfig), - nodeutil.WithTLSConfig( - nodeutil.WithKeyPairFromPath(apiConfig.CertPath, apiConfig.KeyPath), - maybeCA(apiConfig.CACertPath), - ), - nodeutil.AttachProviderRoutes(mux), -======= nodeutil.WithBootstrapFromRestConfig(), ->>>>>>> 1eab7362 (Update mock CLI to use bootstrapper) ) if err != nil { return err diff --git a/node/api/stats.go b/node/api/stats.go index ad8b79d45..95a4952a0 100644 --- a/node/api/stats.go +++ b/node/api/stats.go @@ -48,6 +48,7 @@ func HandlePodStatsSummary(h PodStatsSummaryHandlerFunc) http.HandlerFunc { if _, err := w.Write(b); err != nil { return errors.Wrap(err, "could not write to client") } + _, _ = w.Write([]byte("\n")) return nil }) } diff --git a/node/nodeutil/controller.go b/node/nodeutil/controller.go index 6dcd67a20..205f2b8c8 100644 --- a/node/nodeutil/controller.go +++ b/node/nodeutil/controller.go @@ -109,7 +109,7 @@ func (n *Node) Run(ctx context.Context) (retErr error) { } if n.caController != nil { - go n.caController.Run(1, ctx.Done()) + go n.caController.Run(ctx, 1) } cancelHTTP, err := n.runHTTP(ctx) @@ -217,7 +217,7 @@ func (n *Node) Err() error { // NodeOpt is used as functional options when configuring a new node in NewNodeFromClient type NodeOpt func(c *NodeConfig) error -type caController interface{ Run(int, <-chan struct{}) } +type caController interface{ Run(context.Context, int) } // NodeConfig is used to hold configuration items for a Node. // It gets used in conjection with NodeOpt in NewNodeFromClient