Skip to content

feat: hot-reload apiToken - #591

Closed
cxdy wants to merge 1 commit into
linode:mainfrom
cxdy:feat/hot-reload-token
Closed

feat: hot-reload apiToken#591
cxdy wants to merge 1 commit into
linode:mainfrom
cxdy:feat/hot-reload-token

Conversation

@cxdy

@cxdy cxdy commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Inspired by linode/linode-cloud-controller-manager#576, adds the ability to store apiToken for hot-reloading the token when rotated.

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue
➜  linode-blockstorage-csi-driver git:(feat/hot-reload-token) export DOCKERFILE=Dockerfile.dev IMAGE_VERSION=hot-reload-token
➜  linode-blockstorage-csi-driver git:(feat/hot-reload-token) make docker-build test
DOCKER_BUILDKIT=1 docker build --platform=linux/amd64 --progress=plain \
		-t index.docker.io/linode/linode-blockstorage-csi-driver:hot-reload-token \
		--build-arg REV=hot-reload-token \
		--build-arg GOLANGCI_LINT_VERSION=v2.12.2 \
		-f ./Dockerfile.dev .
#0 building with "desktop-linux" instance using docker driver
#.....
docker run --rm --platform=linux/amd64 --privileged -it index.docker.io/linode/linode-blockstorage-csi-driver:hot-reload-token go test `go list ./... | grep -v ./mocks$` -cover
go: downloading github.com/golang/mock v1.6.0
go: downloading github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
	github.com/linode/linode-blockstorage-csi-driver		coverage: 0.0% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/internal/driver	0.223s	coverage: 82.2% of statements
	github.com/linode/linode-blockstorage-csi-driver/pkg/cryptsetup-client		coverage: 0.0% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/device-manager	0.090s	coverage: 100.0% of statements
	github.com/linode/linode-blockstorage-csi-driver/pkg/filesystem		coverage: 0.0% of statements
	github.com/linode/linode-blockstorage-csi-driver/pkg/hwinfo		coverage: 0.0% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/linode-client	0.119s	coverage: 94.2% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/linode-volumes	0.105s	coverage: 100.0% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/logger	0.079s	coverage: 94.4% of statements
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/mount-manager	0.106s	coverage: 100.0% of statements
	github.com/linode/linode-blockstorage-csi-driver/pkg/observability		coverage: 0.0% of statements
➜  linode-blockstorage-csi-driver git:(feat/hot-reload-token) go test -v ./pkg/linode-client/...
=== RUN   TestNewLinodeClient
=== RUN   TestNewLinodeClient/Valid_input_without_custom_API_URL
=== RUN   TestNewLinodeClient/Valid_input_with_custom_API_URL
=== RUN   TestNewLinodeClient/Invalid_API_URL
--- PASS: TestNewLinodeClient (0.00s)
    --- PASS: TestNewLinodeClient/Valid_input_without_custom_API_URL (0.00s)
    --- PASS: TestNewLinodeClient/Valid_input_with_custom_API_URL (0.00s)
    --- PASS: TestNewLinodeClient/Invalid_API_URL (0.00s)
=== RUN   TestNewLinodeClientWithTokenProviderNil
--- PASS: TestNewLinodeClientWithTokenProviderNil (0.00s)
=== RUN   TestTokenTransportAuthorization
--- PASS: TestTokenTransportAuthorization (0.00s)
=== RUN   TestTokenTransportUsesProviderError
--- PASS: TestTokenTransportUsesProviderError (0.00s)
=== RUN   TestTokenFileProviderCache
--- PASS: TestTokenFileProviderCache (0.00s)
=== RUN   TestTokenFileProviderEmptyFile
--- PASS: TestTokenFileProviderEmptyFile (0.00s)
=== RUN   TestTokenFileProviderMissingFile
--- PASS: TestTokenFileProviderMissingFile (0.00s)
=== RUN   TestTokenFileCacheTTLFromEnv
=== RUN   TestTokenFileCacheTTLFromEnv/default
=== RUN   TestTokenFileCacheTTLFromEnv/configured
=== RUN   TestTokenFileCacheTTLFromEnv/invalid
=== RUN   TestTokenFileCacheTTLFromEnv/non-positive
--- PASS: TestTokenFileCacheTTLFromEnv (0.00s)
    --- PASS: TestTokenFileCacheTTLFromEnv/default (0.00s)
    --- PASS: TestTokenFileCacheTTLFromEnv/configured (0.00s)
    --- PASS: TestTokenFileCacheTTLFromEnv/invalid (0.00s)
    --- PASS: TestTokenFileCacheTTLFromEnv/non-positive (0.00s)
=== RUN   TestTokenProviderFromFileOrEnv
=== RUN   TestTokenProviderFromFileOrEnv/uses_file_when_available
=== RUN   TestTokenProviderFromFileOrEnv/falls_back_to_env_when_file_missing
=== RUN   TestTokenProviderFromFileOrEnv/errors_when_both_unavailable
--- PASS: TestTokenProviderFromFileOrEnv (0.00s)
    --- PASS: TestTokenProviderFromFileOrEnv/uses_file_when_available (0.00s)
    --- PASS: TestTokenProviderFromFileOrEnv/falls_back_to_env_when_file_missing (0.00s)
    --- PASS: TestTokenProviderFromFileOrEnv/errors_when_both_unavailable (0.00s)
=== RUN   TestStaticTokenProvider
--- PASS: TestStaticTokenProvider (0.00s)
PASS
ok  	github.com/linode/linode-blockstorage-csi-driver/pkg/linode-client	(cached)

@cxdy
cxdy requested review from a team as code owners July 16, 2026 02:22
@AshleyDumaine AshleyDumaine added the new-feature for new features in the changelog. label Jul 16, 2026
@cxdy
cxdy force-pushed the feat/hot-reload-token branch from ca76f6f to 340ca49 Compare July 16, 2026 14:56
@cxdy cxdy closed this Jul 16, 2026
@cxdy cxdy mentioned this pull request Jul 16, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants