From 54ea3e170e6d1657fc9e1d55eb169ef7289fb72b Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Tue, 14 May 2024 18:04:17 -0700 Subject: [PATCH] Make `runsc metric-server` root directory check log message less scary. This condition is expected on nodes where the root directory doesn't exist at the time the `runsc metric-server` starts, and the presence of the `--allow-unknown-root` flag means the user expects that this directory doesn't exist. Therefore, it is not a warning and should not sound like one. PiperOrigin-RevId: 633764146 --- runsc/metricserver/metricserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runsc/metricserver/metricserver.go b/runsc/metricserver/metricserver.go index d6e14c967..d4e20d8bf 100644 --- a/runsc/metricserver/metricserver.go +++ b/runsc/metricserver/metricserver.go @@ -845,7 +845,7 @@ func (s *Server) Run(ctx context.Context) error { if !m.allowUnknownRoot { return fmt.Errorf("invalid root directory %q: tried to list sandboxes within it and got: %w", conf.RootDir, err) } - log.Warningf("Invalid root directory %q: tried to list sandboxes within it and got: %v. Continuing anyway, as the server is configured to tolerate this.", conf.RootDir, err) + log.Infof("Root directory %q: tried to list sandboxes within it and got: %v. Continuing anyway, as this is expected with --allow-unknown-root.", conf.RootDir, err) } // container.ListSandboxes uses a glob pattern, which doesn't error out on // permission errors. Double-check by actually listing the directory. @@ -853,7 +853,7 @@ func (s *Server) Run(ctx context.Context) error { if !m.allowUnknownRoot { return fmt.Errorf("invalid root directory %q: tried to list all entries within it and got: %w", conf.RootDir, err) } - log.Warningf("Invalid root directory %q: tried to list all entries within it and got: %v. Continuing anyway, as the server is configured to tolerate this.", conf.RootDir, err) + log.Infof("Root directory %q: tried to list all entries within it and got: %v. Continuing anyway, as this is expected with --allow-unknown-root.", conf.RootDir, err) } m.startTime = time.Now() m.rootDir = conf.RootDir