-
Notifications
You must be signed in to change notification settings - Fork 243
feat: Add Event Recorder #3570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Event Recorder #3570
Changes from all commits
ef224bb
5679da2
4720aa1
6995468
6727ba0
4d40937
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ tests: | |
| resources: | ||
| - events | ||
| verbs: | ||
| - get | ||
| - create | ||
| - patch | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ public class ConfigurationServiceOverrider { | |
| private ExecutorService executorService; | ||
| private ExecutorService workflowExecutorService; | ||
| private LeaderElectionConfiguration leaderElectionConfiguration; | ||
| private String clusterScopedEventNamespace; | ||
| private InformerStoppedHandler informerStoppedHandler; | ||
| private Boolean stopOnInformerErrorDuringStartup; | ||
| private Duration cacheSyncTimeout; | ||
|
|
@@ -131,6 +132,19 @@ public ConfigurationServiceOverrider withLeaderElectionConfiguration( | |
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the namespace in which Kubernetes events about cluster scoped resources are recorded. Use | ||
| * this when the operator is not allowed to create events in the {@code default} namespace, | ||
| * passing for example the namespace the operator itself runs in. | ||
| * | ||
| * @param namespace the namespace to record events about cluster scoped resources in | ||
| * @return this {@link ConfigurationServiceOverrider} for chained customization | ||
| */ | ||
| public ConfigurationServiceOverrider withClusterScopedEventNamespace(String namespace) { | ||
| this.clusterScopedEventNamespace = namespace; | ||
| return this; | ||
|
Comment on lines
+135
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add tests for namespace override and fallback behavior. The supplied integration test does not call Add a focused configuration test for both cases before release. As per coding guidelines, “Add unit and/or integration tests for new functionality whenever reasonably possible.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
|
|
||
| public ConfigurationServiceOverrider withInformerStoppedHandler(InformerStoppedHandler handler) { | ||
| this.informerStoppedHandler = handler; | ||
| return this; | ||
|
|
@@ -258,6 +272,13 @@ public Optional<LeaderElectionConfiguration> getLeaderElectionConfiguration() { | |
| : original.getLeaderElectionConfiguration(); | ||
| } | ||
|
|
||
| @Override | ||
| public String clusterScopedEventNamespace() { | ||
| return clusterScopedEventNamespace != null | ||
| ? clusterScopedEventNamespace | ||
| : original.clusterScopedEventNamespace(); | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<InformerStoppedHandler> getInformerStoppedHandler() { | ||
| return informerStoppedHandler != null | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Hyphenate
cluster-scoped.Line [301] uses
cluster scopedas a compound modifier. Change it tocluster-scoped.Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[grammar] ~301-~301: Use a hyphen to join words.
Context: ...Namespace to record events about cluster scoped resources in (defaults to `defaul...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Source: Linters/SAST tools