Skip to content

Commit

Permalink
incusd/patches: Run auth patches on all servers
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Dec 5, 2024
1 parent c9636be commit bed7a89
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions cmd/incusd/patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,25 +686,6 @@ func patchMoveBackupsInstances(name string, d *Daemon) error {
}

func patchGenericAuthorization(name string, d *Daemon) error {
// Only run authorization patches on the leader.
isLeader := false

leaderAddress, err := d.gateway.LeaderAddress()
if err != nil {
if !errors.Is(err, cluster.ErrNodeIsNotClustered) {
return err
}

isLeader = true
} else if leaderAddress == d.localConfig.ClusterAddress() {
isLeader = true
}

// If clustered and not running on a leader, skip the resource update.
if !isLeader {
return nil
}

return d.authorizer.ApplyPatch(d.shutdownCtx, name)
}

Expand Down

0 comments on commit bed7a89

Please sign in to comment.