Skip to content

docs: document custom config for KubernetesDependentResource - #3743

Open
matheusandre1 wants to merge 1 commit into
operator-framework:mainfrom
matheusandre1:doc-issue2087
Open

matheusandre1 wants to merge 1 commit into
operator-framework:mainfrom
matheusandre1:doc-issue2087

Conversation

@matheusandre1

@matheusandre1 matheusandre1 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #2087

KubernetesDependentResourcealready implementsConfiguredDependentResource, so a subclass cannot plug in its own configuration type. The workaround discussed in the issue (extending KubernetesDependentResourceConfig`) was
never documented, and the sample from the issue no longer compiles against the
current constructor.

Summary by CodeRabbit

  • Documentation
    • Added guidance for supplying custom configuration to a Kubernetes dependent resource and accessing it at runtime.
    • Clarified that a replacement configuration does not merge with annotation-derived settings, so include any settings you want to retain.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2026
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c64cc38a-76f7-4a25-9ee7-0f7d51f8c46d
Commits

Reviewing files that changed from the base of the PR and between 3fdd0a7 and 2d12979.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The configuration guide now describes how to provide custom configuration to a KubernetesDependentResource. A test checks that the overridden configuration exposes its custom value and inherits controller namespaces.

Changes: Custom dependent-resource configuration

Layer / File(s) Summary
Document and test configuration replacement
docs/content/en/docs/documentation/operations/configuration.md, operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverriderTest.java
The guide describes replacing a named dependent resource’s configuration with a KubernetesDependentResourceConfig subclass and notes that the replacement does not merge with annotation-derived settings. The test checks access to the custom value and inheritance of controller namespaces.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: csviri, xstefank

Merge Risk: Minimal · previous review 3fdd0

This PR adds documentation and a test for custom dependent-resource configuration. It does not change runtime behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "docs: document custom config for KubernetesDependentResource" matches the main change. The PR adds a documentation section explaining how to supply a custom configuration to a KubernetesDep…
Linked Issues check Passed [#2087] The issue asks how to supply custom configuration or dependencies to a KubernetesDependentResource, because KubernetesDependentResource already implements ConfiguredDependentResource. The PR a…
Out of Scope Changes check Passed The changes are a documentation update and a unit test. Both relate directly to the issue objective of documenting and verifying how to supply custom configuration to a KubernetesDependentResource. Th…
Full details: Title check

Explanation

The title "docs: document custom config for KubernetesDependentResource" matches the main change. The PR adds a documentation section explaining how to supply a custom configuration to a KubernetesDependentResource by extending KubernetesDependentResourceConfig and replacing the named dependent's configuration. A test is also added to verify the override. The title is specific and short. It names the documentation change and the affected class.

Full details: Linked Issues check

Explanation

[#2087] The issue asks how to supply custom configuration or dependencies to a KubernetesDependentResource, because KubernetesDependentResource already implements ConfiguredDependentResource. The PR adds a section to docs/content/en/docs/documentation/operations/configuration.md. The section documents the workaround: extend KubernetesDependentResourceConfig, replace the named dependent resource configuration during reconciler registration, and read the custom value from configuration(). It also notes that the replacement is not merged with annotation-derived configuration. The PR also adds ControllerConfigurationOverriderTest coverage. The test replaces a named dependent's configuration with a KubernetesDependentResourceConfig subclass, creates the dependent, checks the custom value, and checks that informer namespaces are inherited from the controller. The issue sets no further acceptance criteria. The code and test support the documented workaround, so the issue objective is met.

Full details: Out of Scope Changes check

Explanation

The changes are a documentation update and a unit test. Both relate directly to the issue objective of documenting and verifying how to supply custom configuration to a KubernetesDependentResource. The test verifies the documented behavior, so it supports the objective. No unrelated change appears in the reviewed summary. The summary is the only evidence for these changes. The diff was not inspected directly, so the assessment relies on the summary's description of the files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 360e3ef6-eadb-4595-8469-dd122b7c432d
Commits

Reviewing files that changed from the base of the PR and between 43d925a and 3fdd0a7.

Files selected for processing: 2

  • docs/content/en/docs/documentation/operations/configuration.md
  • operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/ControllerConfigurationOverriderTest.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@matheusandre1
matheusandre1 force-pushed the doc-issue2087 branch 2 times, most recently from 0d9ecdf to 3fdd0a7 Compare December 4, 2026 00:44
@matheusandre1
matheusandre1 marked this pull request as ready for review December 4, 2026 01:19
Copilot AI balanced review requested due to automatic review settings December 4, 2026 01:19
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2026
@openshift-ci
openshift-ci Bot requested review from metacosm and xstefank December 4, 2026 01:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation example lacks a managed workflow and incorrectly assumes the dependent is named configmap, causing the override to throw during registration.

1 open issue
What changed in this PR

Documents how to provide custom configuration to Kubernetes dependent resources, addressing #2087 without changing runtime behavior.

Changes:

  • Shows configuration subclassing, registration, and retrieval using the current API.
  • Explains replacement semantics and namespace inheritance.
  • Adds a regression test for custom configuration injection.
File Description
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​config/​ControllerConfigurationOverriderTest.java Tests extended configuration injection and namespace inheritance.
docs/​content/​en/​docs/​documentation/​operations/​configuration.md Documents the workaround and corrects the configuration interface name.

Review effort: Balanced

Signed-off-by: Matheus André <matheusandr2@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inject config into a KubernetesDependentResource

2 participants