diff --git a/internal/pkg/agent/cmd/container.go b/internal/pkg/agent/cmd/container.go index 24c553b2af5..63f02c41255 100644 --- a/internal/pkg/agent/cmd/container.go +++ b/internal/pkg/agent/cmd/container.go @@ -781,7 +781,7 @@ func setPaths(statePath, configPath, logsPath, socketPath string, writePaths boo if configPath == "" { configPath = statePath } - if _, err := os.Stat(configPath); os.IsNotExist(err) { + if _, err := os.Stat(configPath); errors.Is(err, fs.ErrNotExist) { if err := os.MkdirAll(configPath, 0755); err != nil { return fmt.Errorf("cannot create folders for config path '%s': %w", configPath, err) }