forked from micronaut-projects/micronaut-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send a RefreshEvent when the environment is refreshed because of a Co…
…nfigMap change (micronaut-projects#301) * Make `environment` final The injected `Environment` instance remains the same over `KubernetesConfigMapWatcher`s lifetime. A subsequent commit will anyway replace occurrences of `environment.refresh()` with `environment.refreshAndDiff()`, which does not return a (potentially new) `Environment`. * Remove direct mutations of `environment` Commit 8c29208 introduced a workaround on micronaut-projects/micronaut-core#1903 so that updated `PropertySource`s are reflected in the environment after a refresh. Commit 6d50e2b introduced a local cache for `PropertySource`s so that the client doesn't trigger each time a `RefreshEvent` gets published. Following that, `PropertySource`s were directly added to/removed from two distinct storages: 1. the above mentioned local cache, 2. the current `Environment`. Removing direct mutations of the current `Environment` allows: 1. to get rid of the workaround on micronaut-projects/micronaut-core#1903 which has since been addressed by micronaut-projects/micronaut-core#1965, 2. `environment.refreshAndDiff()` to find and return changes that happened between the former state (`copiedCatalog`: the current `Environment`) and the new one (`catalog`: the local cache). Changes in `PropertySource`s will anyway get automatically propagated to the environment. * Send a RefreshEvent when a ConfigMap change affects the Environment Co-authored-by: Regis Desgroppes <rdesgroppes@users.noreply.github.com> Co-authored-by: Regis Desgroppes <rdesgroppes@users.noreply.github.com>
- Loading branch information
1 parent
20244fd
commit f9de203
Showing
2 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters