[
https://issues.apache.org/jira/browse/CAMEL-25653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144102#comment-18144102
]
shashank commented on CAMEL-25653:
----------------------------------
Yes, I still plan to do it, thanks for the reminder. I'll pick it up now: the
shared watch loop and retry delays in KubernetesHelper, and an informer so an
update made while re-watching is not missed. PR to follow shortly.
_Claude Code on behalf of allthingssecurity_
> camel-kubernetes - share the watch loop of the secret and config map reload
> tasks, and use an informer so no update is missed
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25653
> URL: https://issues.apache.org/jira/browse/CAMEL-25653
> Project: Camel
> Issue Type: Improvement
> Components: camel-kubernetes
> Reporter: Claus Ibsen
> Assignee: shashank
> Priority: Minor
> Fix For: 4.25.0
>
>
> Follow-up from the review of https://github.com/apache/camel/pull/27801
> (CAMEL-25614).
> h3. 1. Share the reload watch loop
> After CAMEL-25614, {{SecretsReloadTriggerTask}} and
> {{ConfigmapsReloadTriggerTask}} have the same {{run()}},
> {{waitBeforeWatchingAgain()}} and {{doStop()}} logic (about 70 lines), apart
> from the resource type they watch. The retry delays (1 s, doubling to 30 s)
> are a third copy of the constants in {{KubernetesHelper}} (CAMEL-25273). The
> {{KubernetesHelper}} constants are package-private, so the {{secrets.vault}}
> and {{config_maps.vault}} packages cannot use them.
> Move the loop into one shared helper, for example one that takes a
> {{Function<CountDownLatch, Watch>}}, and have the tasks and
> {{KubernetesHelper}} use the same delay constants, so the three copies cannot
> drift apart.
> h3. 2. Do not miss updates while re-watching
> The reload tasks miss any secret or config map update made between the close
> of a watch and the start of the next one. A fabric8 informer ({{inform()}}
> with a {{ResourceEventHandler}}) lists the resources again after a 410 Gone,
> which would close that gap.
> The PR author (allthingssecurity) offered to do both as a follow-up.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)