Skip to content

Commit

Permalink
fix: existing clusters and secretes
Browse files Browse the repository at this point in the history
Signed-off-by: Huabing Zhao <[email protected]>
  • Loading branch information
zhaohuabing committed Nov 12, 2024
1 parent ec56a83 commit 87b5867
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/xds/translator/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func createOAuth2TokenEndpointCluster(tCtx *types.ResourceVersionTable,
return err
}

return err
return nil
}

// createOAuth2Secrets creates OAuth2 client and HMAC secrets from the provided
Expand All @@ -392,11 +392,11 @@ func createOAuth2Secrets(tCtx *types.ResourceVersionTable, routes []*ir.HTTPRout
// a separate secret is created for each route, even they share the same
// oauth2 client ID and secret.
clientSecret := buildOAuth2ClientSecret(route.Security.OIDC)
if err := addXdsSecret(tCtx, clientSecret); err != nil {
if err := addXdsSecret(tCtx, clientSecret); err != nil && !errors.Is(err, ErrXdsSecretExists) {
errs = errors.Join(errs, err)
}

if err := addXdsSecret(tCtx, buildOAuth2HMACSecret(route.Security.OIDC)); err != nil {
if err := addXdsSecret(tCtx, buildOAuth2HMACSecret(route.Security.OIDC)); err != nil && !errors.Is(err, ErrXdsSecretExists) {
errs = errors.Join(errs, err)
}
}
Expand Down

0 comments on commit 87b5867

Please sign in to comment.