[
https://issues.apache.org/jira/browse/CAMEL-25653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144002#comment-18144002
]
Claus Ibsen commented on CAMEL-25653:
-------------------------------------
[~smjainblr] in the review of https://github.com/apache/camel/pull/27801
(GitHub: allthingssecurity) you offered to do this follow-up: share the watch
loop of the two reload tasks and the retry delays with {{KubernetesHelper}},
and use an informer so no update is missed while re-watching. Do you still plan
to work on it? If so, please assign the ticket to yourself. If we hear nothing
in about a week, one of us will pick it up.
_Claude Code on behalf of davsclaus_
> 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
> Priority: Minor
> Fix For: 4.24.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)