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
This commit is contained in:
Etienne Perot
2024-05-14 18:07:57 -07:00
committed by gVisor bot
parent 89f5550a36
commit 54ea3e170e
+2 -2
View File
@@ -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