Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jroper
Copy link
Contributor

@jroper jroper commented Nov 3, 2025

Fixes #350

This implements token reloading for in cluster config. It's built on #424 so that needs to be reviewed/merged first.

Also fixed a resource leak where the input streams for reading the files for in cluster config were not being closed. This was necessary to fix given that we're now frequently loading those streams.

// This is configurable, hence we allow it to be overridden by an environment variable.
// Note that the equivalent Go code for this reloads every minute, erroneously stating in a comment that tokens are
// rotated every 10 minutes. See https://github.com/kubernetes/client-go/blob/4f9edc15a7e71c3f9c7874a872a2545c8737726c/transport/token_source.go#L75-L79
sys.env.get("SKUBER_TOKEN_RELOAD_INTERVAL_SECONDS")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we explicitly check that if the value is zero or less and if so then disable the token reloading? This is in case there is some edge case where token reloading is problematic so users can restore the old behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree.

@doriordan
Copy link
Owner

I merged #424, there is now a conflict that needs fixing, and I also left a single comment requesting a small change. Other than that looks good to me.

Fixes doriordan#350

This implements token reloading for in cluster config. It's built on doriordan#424 so
that needs to be reviewed/merged first.

Also fixed a resource leak where the input streams for reading the files for
in cluster config were not being closed. This was necessary to fix given that
we're now frequently loading those streams.
@jroper jroper force-pushed the reloadable-access-tokens branch from f1a58e6 to b1adf3a Compare November 5, 2025 01:45
@jroper
Copy link
Contributor Author

jroper commented Nov 5, 2025

Rebased and updated to make reloading possible to disable.

@doriordan doriordan merged commit 5fcb13d into doriordan:master Nov 5, 2025
@jroper jroper deleted the reloadable-access-tokens branch November 6, 2025 03:41
doriordan pushed a commit that referenced this pull request Nov 10, 2025
Fixes #350

This implements token reloading for in cluster config. It's built on #424 so
that needs to be reviewed/merged first.

Also fixed a resource leak where the input streams for reading the files for
in cluster config were not being closed. This was necessary to fix given that
we're now frequently loading those streams.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stale service account token after 90 days, after EKS 1.21 release

2 participants