Skip to content

Commit

Permalink
Merge pull request #3160 from lonelyCZ/pr-fix-update-or-create-token
Browse files Browse the repository at this point in the history
Fix UpdateOrCreateToken get secrets err handling optimization
  • Loading branch information
karmada-bot authored Feb 16, 2023
2 parents 0eb69c1 + 8b67d22 commit e523977
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/karmadactl/util/bootstraptoken/bootstraptoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func UpdateOrCreateToken(client kubeclient.Interface, failIfExists bool, token *
if err != nil && !apierrors.IsNotFound(err) {
return err
}
if secret != nil && failIfExists {
if secret != nil && err == nil && failIfExists {
return fmt.Errorf("a token with id %q already exists", token.Token.ID)
}

Expand Down

0 comments on commit e523977

Please sign in to comment.