Reloading IAM after raft snapshot restore

This commit is contained in:
Ingo Oppermann 2026-03-06 13:07:29 +01:00
parent c39d2ec12e
commit 3535f527fb
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
2 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,9 @@ func (c *cluster) IAM(superuser iamidentity.User, jwtRealm, jwtSecret string) (i
return nil, fmt.Errorf("cluster iam: %w", err)
}
iam.ReloadIndentities()
iam.ReloadPolicies()
return iam, nil
}

View File

@ -491,6 +491,17 @@ func (s *store) Snapshot() (raft.FSMSnapshot, error) {
func (s *store) Restore(snapshot io.ReadCloser) error {
s.logger.Debug().Log("Snapshot restore")
defer func() {
s.logger.Info().Log("Snapshot restored")
s.lock.RLock()
if s.callback != nil {
s.callback(OpAddIdentity)
s.callback(OpSetPolicies)
}
s.lock.RUnlock()
}()
defer snapshot.Close()
s.lock.Lock()