Skip to content

Commit

Permalink
Fixing bug in issuer cache when updating idm type of a tenant. (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Aug 17, 2021
1 parent 7ea18f5 commit b767865
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions issuercache.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ func (i *MultiIssuerCache) syncCache(newIcs []*IssuerConfig) error {
continue
}

// update the annotations always
v.issuerConfig.Annotations = newTenantConfig.Annotations

// found existing cached tenant, check for update
newCidIssKey := cacheKey(newTenantConfig.Issuer, newTenantConfig.ClientID)
if cidIssKey != newCidIssKey {
Expand All @@ -216,7 +219,7 @@ func (i *MultiIssuerCache) syncCache(newIcs []*IssuerConfig) error {
delete(i.cache, cidIssKey)
// add new entry
i.cache[newCidIssKey] = &Issuer{issuerConfig: newTenantConfig}
i.log.Info("syncCache - updated tenant in cache", "tenant", tenant, "key", cidIssKey)
i.log.Info("syncCache - updated tenant in cache", "tenant", tenant, "key", cidIssKey, "annotations", newTenantConfig.Annotations)
}

// delete entry from newTenantIDMap, as it is already processed
Expand All @@ -227,7 +230,7 @@ func (i *MultiIssuerCache) syncCache(newIcs []*IssuerConfig) error {
for _, ic := range newTenantIDMap {
key := cacheKey(ic.Issuer, ic.ClientID)
i.cache[key] = &Issuer{issuerConfig: ic}
i.log.Info("syncCache - add tenant to cache", "tenant", ic.Tenant, "key", key)
i.log.Info("syncCache - add tenant to cache", "tenant", ic.Tenant, "key", key, "annotations", ic.Annotations)
}
return nil
}
Expand Down

0 comments on commit b767865

Please sign in to comment.