Revoking Cluster Access Token with same name deletes earliest token

Summary

  • Once a Kubernetes cluster has been created, multiple access tokens for the cluster
  • Multiple keys can be created with the same name
  • When a user attempts to revoke an access token with a duplicate name, the interface creates two modals, one for each duplicate
    • The modal that appears at the front is for the newest token, with the modal for the older token being hidden behind it

Steps to reproduce

  1. Create a Cluster agent in a namespace
  • This will create a Cluster access token with the same name as the cluster agent
  1. Create a Cluster access token with the same name as the automatically created token
  2. Revoke the newest token
  3. Note that:
  • After dismissing one modal there is a duplicate modal behind the dismissed one
  • Note that the oldest token was removed

What is the current bug behavior?

  • The token nominated for revocation by the user is not necessarily the token that is revoked; instead the oldest token will be removed first

What is the expected correct behavior?

  • The token selected by the user should be the one revoked
  • Only one modal should appear

Relevant logs and/or screenshots

  • Creating the duplicate cluster access token

image

  • The resulting duplicate access tokens:

image

  • Removing the newest key:

image

  • Results in the oldest key being removed:

image

Possible fixes