Skip to content

Add automatic cache cleanup on version change#4051

Merged
thallgren merged 1 commit intorelease/v2from
thallgren/versioned-cache
Feb 15, 2026
Merged

Add automatic cache cleanup on version change#4051
thallgren merged 1 commit intorelease/v2from
thallgren/versioned-cache

Conversation

@thallgren
Copy link
Member

Summary

  • Track CLI version in ~/.cache/telepresence/version.json
  • When the major.minor version changes, automatically quit running daemons and clear stale cache entries (preserving logs)
  • Patch and pre-release version changes do not trigger cleanup

Test plan

  • Build and run telepresence version — verify version.json is created in cache dir
  • Edit version.json to a different major.minor version, run any CLI command — verify daemons quit and cache cleared (except logs)
  • Edit version.json to same major.minor but different patch — verify no cleanup occurs
  • Delete version.json, run any CLI command — verify cache is cleared and file recreated

@thallgren thallgren force-pushed the thallgren/versioned-cache branch from 51801d8 to 67716a5 Compare February 9, 2026 03:37
@thallgren thallgren added the ok to test Applied by maintainers when a PR is ready to have tests run on it label Feb 9, 2026
@github-actions github-actions bot removed the ok to test Applied by maintainers when a PR is ready to have tests run on it label Feb 9, 2026
Track the CLI version in a version.json file in the cache directory.
When a version mismatch is detected, quit running daemons and clear
stale cache entries (preserving logs) to prevent issues from leftover
files after an upgrade.

Signed-off-by: Thomas Hallgren <thomas@tada.se>
@thallgren thallgren force-pushed the thallgren/versioned-cache branch from 67716a5 to 47bb6d0 Compare February 14, 2026 16:08
@thallgren thallgren added the ok to test Applied by maintainers when a PR is ready to have tests run on it label Feb 14, 2026
@github-actions github-actions bot removed the ok to test Applied by maintainers when a PR is ready to have tests run on it label Feb 14, 2026
@thallgren thallgren merged commit bc5559e into release/v2 Feb 15, 2026
10 checks passed
@thallgren thallgren deleted the thallgren/versioned-cache branch February 15, 2026 08:31
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.

1 participant

Comments