| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Refactors Operator#initConfigurationService to compose the provided KubernetesClient into the configuration overrider only when a client is explicitly supplied, simplifying initialization.
Changes:
Sorry, something went wrong.
|
Please re-run the workflow. It was previously failing the Spotless check because I committed the GitHub Copilot suggestion as-is, assuming it was already formatted correctly. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
thank you @Dennis-Mircea !
Sorry, something went wrong.
…tor constructor Signed-off-by: Dennis-Mircea Ciupitu <dennis.mircea.ciupitu@gmail.com>
|
@metacosm please take a look. thx! |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, I would be surprised if we rely on this in QOSDK.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Operator.initConfigurationService invokes the caller-supplied Consumer<ConfigurationServiceOverrider> twice when the Operator(Consumer<ConfigurationServiceOverrider>) constructor is used. Any side-effecting code inside that consumer (e.g. logging) is therefore emitted twice on startup.
Observed in downstream operators such as Apache Flink Kubernetes Operator, which configures the operator via new Operator(this::overrideOperatorConfigs) and ends up logging each startup line twice:
Root cause
Today's initConfigurationService does a two-pass build when client == null:
Each newOverriddenConfigurationService(overrider) call invokes the user's overrider once, so it runs twice in the client == null path. The Operator(KubernetesClient) path is unaffected and it skips the first pass.
The second pass exists to "pin" the resolved KubernetesClient back onto the configuration service via withKubernetesClient(...). That pinning is redundant: AbstractConfigurationService#getKubernetesClient() already memoizes the client lazily on first read, so any consumer asking the service for its client gets the same instance whether it was set explicitly or constructed lazily.
Fix
Collapse to a single pass:
Compatibility
Test plan