Skip to content

Commit

Permalink
Remove the TokenReview after checking we can create it (#2286)
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
  • Loading branch information
iblancasa authored Aug 9, 2023
1 parent dde9e07 commit 129f24a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/autodetect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ func (b *Background) detectClusterRoles(ctx context.Context) {
if currentAuthDelegator != newAuthDelegator || !viper.IsSet("auth-delegator-available") {
viper.Set("auth-delegator-available", newAuthDelegator)
}

if err := b.cl.Delete(ctx, tr); err != nil {
// Remove the test Token.
// If the token could not be created due to permissions, we're ok.
// If the token was created, we remove it to ensure the next iteration doesn't fail.
// If the token creation failed because it was created before, we remove it to ensure the next iteration doesn't fail.
log.Log.V(2).Info("The jaeger-operator-TEST TokenReview could not be removed: %w", err)
}
}

func isOpenShift(apiList []*metav1.APIResourceList) bool {
Expand Down

0 comments on commit 129f24a

Please sign in to comment.