Skip to content

Commit

Permalink
Fix v9 trusted cluster DB CA sync
Browse files Browse the repository at this point in the history
  • Loading branch information
jakule authored and github-actions committed Jun 30, 2022
1 parent 9def3b5 commit be72e33
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/cache/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,14 @@ func (c *certAuthority) fetch(ctx context.Context) (apply func(ctx context.Conte
return nil, trace.Wrap(err)
}

// DELETE IN 11.0.
// missingDatabaseCA is needed only when leaf cluster v9 is connected
// to root cluster v10.
missingDatabaseCA := false
applyDatabaseCAs, err := c.fetchCertAuthorities(ctx, types.DatabaseCA)
if err != nil {
if trace.IsBadParameter(err) {
missingDatabaseCA = true
} else if err != nil {
return nil, trace.Wrap(err)
}

Expand All @@ -822,8 +828,10 @@ func (c *certAuthority) fetch(ctx context.Context) (apply func(ctx context.Conte
if err := applyUserCAs(ctx); err != nil {
return trace.Wrap(err)
}
if err := applyDatabaseCAs(ctx); err != nil {
return trace.Wrap(err)
if !missingDatabaseCA {
if err := applyDatabaseCAs(ctx); err != nil {
return trace.Wrap(err)
}
}
return trace.Wrap(applyJWTSigners(ctx))
}, nil
Expand Down

0 comments on commit be72e33

Please sign in to comment.