Skip to content

Commit

Permalink
lxd/ubuntupro: Always use inotify for watching pro configuration.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Laing <mark.laing@canonical.com>
  • Loading branch information
markylaing committed Sep 25, 2024
1 parent bd907c0 commit 6770162
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lxd/ubuntupro/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ func (s *Client) watch(ctx context.Context, ubuntuAdvantageDir string) error {
logger.Warn("Failed to read Ubunto Pro LXD configuration file", logger.Ctx{"err": err})
}

// Watch /var/lib/ubuntu-advantage for write, remove, and rename events.
monitor, err := drivers.Load(ctx, ubuntuAdvantageDir, fsmonitor.EventWrite, fsmonitor.EventRemove, fsmonitor.EventRename)
// Watch /var/lib/ubuntu-advantage for write, remove, and rename events. Use the inotify driver because the path is
// not a mountpoint.
monitor, err := drivers.Load(ctx, fsmonitor.DriverNameINotify, ubuntuAdvantageDir, fsmonitor.EventWrite, fsmonitor.EventRemove, fsmonitor.EventRename)
if err != nil {
return fmt.Errorf("Failed to create a file monitor: %w", err)
}
Expand Down

0 comments on commit 6770162

Please sign in to comment.