Skip to content

Honor the configured refresh interval for FromConfigMap polling #4973

Closed

Description

@brendandburns

Problem

KubernetesFromConfigMapProcessor schedules updates at kubernetes.manifests.refreshInterval (default five seconds), but the default PollingConfigMapGetter caches successful reads for five minutes. Most refresh executions only copy the old cached value, contrary to the refresh contract documented by @FromConfigMap.

Locations:

  • spring/src/main/java/io/kubernetes/client/spring/extended/manifests/KubernetesFromConfigMapProcessor.java:80-89
  • spring/src/main/java/io/kubernetes/client/spring/extended/manifests/configmaps/PollingConfigMapGetter.java:27-43
  • spring/src/main/java/io/kubernetes/client/spring/extended/manifests/annotation/FromConfigMap.java:27-28
  • spring/src/main/java/io/kubernetes/client/spring/extended/manifests/config/KubernetesManifestsProperties.java:20

Reproduction

Use the default polling getter with a short configured refresh interval, read a ConfigMap, change it on the server, and wait several refresh intervals. The injected map still contains the original data until the getter's five-minute cache expires.

Impact

Configuration updates can remain invisible for nearly five minutes despite a much shorter configured refresh interval. Suggested priority: medium.

Requested fix and acceptance criteria

  • Ensure the default polling path observes server changes at the configured refresh cadence instead of being overridden by a fixed five-minute cache.
  • Add a regression test exercising the real polling getter against a mock API server rather than only testing with a custom in-memory getter.
  • Keep tests bounded and avoid multi-minute sleeps.
  • Preserve public APIs and document any necessary behavior clarification.
  • A separate issue addresses cross-client isolation of the polling caches. Keep this patch focused on cadence and compatible with instance-scoped caches.

Agent instructions

Implement the fix, run relevant regression tests, and open a pull request referencing and closing this issue. Follow the repository's PR template and contribution conventions. Other agents may change nearby Spring code; keep unrelated fixes out of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions