Skip to content

Commit 268b24a

Browse files
drewhlicopybara-github
authored andcommitted
Remove unneeded noise from the cleanup watcher in case the plugin state directory hasn't been created yet.
PiperOrigin-RevId: 869935168
1 parent c387853 commit 268b24a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/plugin/manager/cleanup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func (m *PluginManager) retryFailedRemovals(ctx context.Context) (bool, error) {
3939
pluginInstallLoc := filepath.Join(baseState(), pluginInstallDir)
4040
pluginDirs, err := os.ReadDir(pluginInstallLoc)
4141
if err != nil {
42+
if errors.Is(err, os.ErrNotExist) {
43+
galog.Debugf("Plugin install directory %q does not exist, nothing to clean up", pluginInstallLoc)
44+
return true, nil
45+
}
4246
return true, fmt.Errorf("failed to read plugin install directory: %w", err)
4347
}
4448

0 commit comments

Comments
 (0)