Skip to content

Add ageing cache to dns alias driver - #1071

Open
PaulJouvanceau wants to merge 1 commit into
opensvc:mainfrom
PaulJouvanceau:fix/ageing-cache-integration
Open

Add ageing cache to dns alias driver#1071
PaulJouvanceau wants to merge 1 commit into
opensvc:mainfrom
PaulJouvanceau:fix/ageing-cache-integration

Conversation

@PaulJouvanceau

Copy link
Copy Markdown
Contributor
  • Cache getAliases responses with a configurable TTL (default 30s).
  • Use a sentinel value ("null") to cache 404 (no aliases) without poisoning the cache with nil.
  • Invalidate the cache after every mutation (create, update, delete).
  • Explicitly clear the cache before Start, Stop, and Status to ensure fresh data.
  • Expose CacheTTL on the mgr struct so tests can disable the cache (set to 0) and avoid filesystem permission issues.

Changes:

  • drivers/resipsgcp_dnsalias/main.go
  • drivers/resipsgcp_dnsalias/mgr.go
  • drivers/resipsgcp_dnsalias/main_test.go

- Cache getAliases responses with a configurable TTL (default 30s).
- Use a sentinel value ("null") to cache 404 (no aliases) without
  poisoning the cache with nil.
- Invalidate the cache after every mutation (create, update, delete).
- Explicitly clear the cache before Start, Stop, and Status to ensure
  fresh data.
- Expose CacheTTL on the mgr struct so tests can disable the cache
  (set to 0) and avoid filesystem permission issues.

Changes:
- drivers/resipsgcp_dnsalias/main.go
- drivers/resipsgcp_dnsalias/mgr.go
- drivers/resipsgcp_dnsalias/main_test.go
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