-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove association between ServiceAccounts and token Secrets
If a token Secret is associated to a ServiceAccount via its "secrets" field, K8s 1.27 interprets this as an auto-generated token and issues a client-side warning: "Use tokens from the TokenRequest API or manually created secret-based tokens instead of auto-generated secret-based tokens." While we no longer use auto-generated Secrets, we do still set the "secrets" field with the manually created Secret which causes the warning to be generated for every API call issued using a rest config created with the Secret's token. We don't need to set the "secrets" field - we can locate a ServiceAccount's associated Secret via the "kubernetes.io/service-account.name" annotation on the Secret. For migration, also remove the "secrets" field from existing ServiceAccounts. As a further safeguard on upgrade, ignore the warning via the warning handler. Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
- Loading branch information
Showing
5 changed files
with
71 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters