Skip to content

✨ DSF: Support Extra Volumes Injection for hub components - #118

Merged
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
Evernorth:dsf-support-volume-injection
May 14, 2026
Merged

✨ DSF: Support Extra Volumes Injection for hub components#118
openshift-merge-bot[bot] merged 1 commit into
open-cluster-management-io:mainfrom
Evernorth:dsf-support-volume-injection

Conversation

@xinkechen-evernorth

@xinkechen-evernorth xinkechen-evernorth commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR seeks to modify the Dynamic Scoring Framework helm chart templating to allow specification of additional volumes with the motivating use case being to inject additional ConfigMaps and Secrets volumes to augment the controller's trust store.

While deploying an custom scorer per the example and exposing it over TLS via our cluster ingress, we found the controller was unable to communicate with the custom scorer with an error message x509: certificate signed by unknown authority due to our TLS certificate being issued by our internal CA.

This PR fixes this issue by allowing one to provide a custom configmap with a relevant PEM encoded certificates (or as applicable have said data be injected by automation and mounting the relevant data over /etc/ssl/certs to allow the controller verify the TLS certificate.

Example:

trusted-ca Configmap:

kind: ConfigMap
apiVersion: v1
metadata:
  name: trusted-ca
data:
  ca-bundle.crt: |
    # ... trimmed for brevity

values.yaml snippet:

hubSetting:
  extraVolumes:
    - name: trusted-ca
      configMap:
        name: trusted-ca
        items:
          - key: ca-bundle.crt 
            path: ca-certificates.crt
     
  extraVolumeMounts:
    - name: trusted-ca
      mountPath: /etc/ssl/certs/
      readOnly: true

Related issue(s)

N/A

Summary by CodeRabbit

  • New Features
    • Controllers now support custom pod volumes and container volume mounts, allowing users to inject additional storage/configuration via deployment settings.
    • New configurable values added (with defaults and examples) to enable extraVolumes and extraVolumeMounts for hub controllers, defaulting to empty lists when not provided.

Review Change Stack

@openshift-ci
openshift-ci Bot requested review from KA-Takeuchi and qiujian16 May 13, 2026 20:36
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9d71ad5-c4a2-4598-8390-bd2684ccf28e

📥 Commits

Reviewing files that changed from the base of the PR and between e27284d and 018e9f9.

📒 Files selected for processing (3)
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/values.yaml

Walkthrough

This PR extends two controller Helm chart deployments to accept user-provided extra volumes and volume mounts. A new configuration contract in values.yaml defines hubSetting.extraVolumes and hubSetting.extraVolumeMounts fields, which are then applied to the addon-controller and dynamic-scoring-controller templates via Helm conditionals.

Changes

Hub Controller Volume Configuration

Layer / File(s) Summary
Helm values for extra volumes and mounts
dynamic-scoring-framework/charts/dynamic-scoring-framework/values.yaml
New hubSetting.extraVolumes and hubSetting.extraVolumeMounts configuration fields are added with empty-list defaults and inline examples documenting expected YAML structure for users.
Addon controller template updates
dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml
Container volumeMounts and pod-level volumes blocks are added with Helm conditionals that render the new hubSetting values or fall back to empty lists.
Dynamic scoring controller template updates
dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml
Container volumeMounts and pod-level volumes blocks are updated to conditionally render the new hubSetting values instead of static empty lists.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding support for extra volumes injection in the Dynamic Scoring Framework Helm chart.
Description check ✅ Passed The description follows the template with Summary and Related issue(s) sections. It provides comprehensive context for the change including motivation, problem statement, and usage examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml (1)

395-412: ⚡ Quick win

Consider omitting empty volumeMounts and volumes fields rather than rendering empty lists.

The current pattern always renders the volumeMounts: and volumes: keys, then either the list items or []. While functionally correct, the more idiomatic Kubernetes pattern is to omit optional fields entirely when they have no values. This matches the refactoring suggestion for the addon-controller template.

♻️ Refactor to omit fields when empty
-        volumeMounts:
         {{- with .Values.hubSetting.extraVolumeMounts }}
-{{ toYaml . | nindent 10 }}
-        {{- else }}
-          []
+        volumeMounts:
+        {{- toYaml . | nindent 10 }}
         {{- end }}
       securityContext:
         runAsNonRoot: true
         seccompProfile:
           type: RuntimeDefault
       serviceAccountName: dynamic-scoring-framework-controller
       terminationGracePeriodSeconds: 10
-      volumes:
       {{- with .Values.hubSetting.extraVolumes }}
-{{ toYaml . | nindent 8 }}
-      {{- else }}
-        []
+      volumes:
+      {{- toYaml . | nindent 8 }}
       {{- end }}

Note: The YAMLlint syntax error on line 397 is a false positive—Helm templates are not valid YAML before rendering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml`
around lines 395 - 412, Replace the current always-rendered "volumeMounts:" and
"volumes:" keys with conditional blocks so the keys are emitted only when their
arrays are non-empty: use {{- with .Values.hubSetting.extraVolumeMounts }} to
emit the "volumeMounts:" key followed by the indented {{ toYaml . | nindent 10
}} and close the with, and similarly use {{- with
.Values.hubSetting.extraVolumes }} to emit "volumes:" with {{ toYaml . | nindent
8 }}; reference the existing .Values.hubSetting.extraVolumeMounts,
.Values.hubSetting.extraVolumes and the volumeMounts/volumes entries in the
dynamic-scoring-controller.yaml template when making the change.
dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml (1)

26-37: ⚡ Quick win

Consider omitting empty volumeMounts and volumes fields rather than rendering empty lists.

The current pattern always renders the volumeMounts: and volumes: keys, then either the list items or []. While functionally correct, the more idiomatic Kubernetes pattern is to omit optional fields entirely when they have no values.

♻️ Refactor to omit fields when empty
-        volumeMounts:
         {{- with .Values.hubSetting.extraVolumeMounts }}
-{{ toYaml . | nindent 10 }}
-        {{- else }}
-          []
+        volumeMounts:
+        {{- toYaml . | nindent 10 }}
         {{- end }}
-      volumes:
       {{- with .Values.hubSetting.extraVolumes }}
-{{ toYaml . | nindent 8 }}
-      {{- else }}
-        []
+      volumes:
+      {{- toYaml . | nindent 8 }}
       {{- end }}

Note: The YAMLlint syntax error on line 28 is a false positive—Helm templates are not valid YAML before rendering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml`
around lines 26 - 37, The template currently always emits the volumeMounts: and
volumes: keys and renders [] when .Values.hubSetting.extraVolumeMounts or
.Values.hubSetting.extraVolumes are empty; change the template so the entire
volumeMounts and volumes keys are only rendered when there are items—e.g., use a
conditional around each key (check .Values.hubSetting.extraVolumeMounts and
.Values.hubSetting.extraVolumes or use with that places the key inside the with
block) so that volumeMounts and volumes are omitted entirely when empty;
reference the .Values.hubSetting.extraVolumeMounts,
.Values.hubSetting.extraVolumes, and the volumeMounts/volumes keys in your
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml`:
- Around line 26-37: The template currently always emits the volumeMounts: and
volumes: keys and renders [] when .Values.hubSetting.extraVolumeMounts or
.Values.hubSetting.extraVolumes are empty; change the template so the entire
volumeMounts and volumes keys are only rendered when there are items—e.g., use a
conditional around each key (check .Values.hubSetting.extraVolumeMounts and
.Values.hubSetting.extraVolumes or use with that places the key inside the with
block) so that volumeMounts and volumes are omitted entirely when empty;
reference the .Values.hubSetting.extraVolumeMounts,
.Values.hubSetting.extraVolumes, and the volumeMounts/volumes keys in your
change.

In
`@dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml`:
- Around line 395-412: Replace the current always-rendered "volumeMounts:" and
"volumes:" keys with conditional blocks so the keys are emitted only when their
arrays are non-empty: use {{- with .Values.hubSetting.extraVolumeMounts }} to
emit the "volumeMounts:" key followed by the indented {{ toYaml . | nindent 10
}} and close the with, and similarly use {{- with
.Values.hubSetting.extraVolumes }} to emit "volumes:" with {{ toYaml . | nindent
8 }}; reference the existing .Values.hubSetting.extraVolumeMounts,
.Values.hubSetting.extraVolumes and the volumeMounts/volumes entries in the
dynamic-scoring-controller.yaml template when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66869e19-3c5f-4e84-85b2-75f12613d6e2

📥 Commits

Reviewing files that changed from the base of the PR and between 274a001 and e27284d.

📒 Files selected for processing (3)
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/addon-controller.yaml
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/templates/dynamic-scoring-controller.yaml
  • dynamic-scoring-framework/charts/dynamic-scoring-framework/values.yaml

@mikeshng mikeshng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

/lgtm

This is a reasonable change by providing additional optional values. Thank you for your contribution!

Signed-off-by: xinkechen-evernorth <186659632+xinkechen-evernorth@users.noreply.github.com>
@xinkechen-evernorth
xinkechen-evernorth force-pushed the dsf-support-volume-injection branch from e27284d to 018e9f9 Compare May 14, 2026 16:44
@openshift-ci openshift-ci Bot removed the lgtm label May 14, 2026
@xinkechen-evernorth

Copy link
Copy Markdown
Contributor Author

FYI - force pushed the change to include DCO signoff

@mikeshng mikeshng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label May 14, 2026
@openshift-ci

openshift-ci Bot commented May 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikeshng, xinkechen-evernorth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 4394450 into open-cluster-management-io:main May 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants