Skip to content

Conversation

riprasad
Copy link
Member

@riprasad riprasad commented Aug 9, 2025

Description

Add support to override OAuth proxy image for odh notebook controller

DO NOT MERGE until opendatahub-io/kubeflow#671 is merged

https://issues.redhat.com/browse/RHOAIENG-31618
https://issues.redhat.com/browse/RHOAIENG-31730

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Summary by CodeRabbit

  • New Features
    • Added support for specifying a custom OAuth proxy image in the notebook controller deployment.

Copy link

coderabbitai bot commented Aug 9, 2025

Walkthrough

A new parameter, "oauth-proxy-image", with the value "RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE", has been added to the map passed to the odhdeploy.ApplyParams function in the Init method of the componentHandler struct. No other logic or public interfaces were changed.

Changes

Cohort / File(s) Change Summary
Parameter Addition in Workbenches Controller
internal/controller/components/workbenches/workbenches.go
Added "oauth-proxy-image" key with value "RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE" to deployment parameters in Init.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🥕 A new key hops into the map,
"oauth-proxy-image" takes its lap.
With carrots and code, I tweak and I play,
Ensuring safe logins the rabbit way.
A tiny change, a gentle cheer—
More secure workbenches are finally here!

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch RHOAIENG-31618

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested a review from AjayJagan August 9, 2025 21:50
Copy link

openshift-ci bot commented Aug 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign marianmacik for approval. For more information see the Code Review Process.

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

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 633bfb8 and fc8b591.

📒 Files selected for processing (1)
  • internal/controller/components/workbenches/workbenches.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kahowell
PR: opendatahub-io/opendatahub-operator#2220
File: bundle.rhoai/manifests/rhods-operator.clusterserviceversion.yaml:1548-1550
Timestamp: 2025-07-29T18:44:42.749Z
Learning: In the opendatahub-operator repository's rhoai branch, the CSV manifest intentionally uses `quay.io/opendatahub/opendatahub-operator:latest` as the image reference even though it's for the rhods-operator, and this configuration difference from the main branch is by design.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build/push catalog image
  • GitHub Check: golangci-lint
  • GitHub Check: Run tests and collect coverage on internal and pkg
  • GitHub Check: Run tests and collect coverage on tests/integration
🔇 Additional comments (1)
internal/controller/components/workbenches/workbenches.go (1)

55-57: Addition of oauth-proxy image param — LGTM

This aligns with the PR objective to enable downstream override. No behavioral risk in this file.

Comment on lines 55 to 57
"odh-notebook-controller-image": "RELATED_IMAGE_ODH_NOTEBOOK_CONTROLLER_IMAGE",
"oauth-proxy-image": "RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE",
}); err != nil {
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify wiring: RELATED_IMAGE env/CSV + downstream placeholder

Please confirm:

  • Operator env/CSV includes RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE (env var and relatedImages entry), or ApplyParams will inject an empty value at build time.
  • The downstream manifest’s params.env actually defines oauth-proxy-image (blocked on the linked kubeflow PR).
  • Consider whether the KF Notebook Controller also needs an oauth-proxy override; if yes, mirror this mapping in the kfNbc ApplyParams block.

Run this to validate in-repo wiring (CSV/env/duplicates). Note: the params.env placeholder likely lives in the kubeflow repo; absence here can be expected until that PR merges.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Search for the new RELATED_IMAGE env var occurrences"
rg -n 'RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE' || true

echo
echo "2) Check CSVs for relatedImages/env wiring mentioning oauth-proxy"
fd -a 'clusterserviceversion.yaml' | while read -r f; do
  echo "--- $f"
  rg -n -N 'relatedImages|oauth|OSE_OAUTH_PROXY' "$f" -A 3 -B 3 || true
done

echo
echo "3) Check manager manifests for the env var"
fd -a 'manager.yaml' | while read -r f; do
  echo "--- $f"
  rg -n 'RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE|env:' "$f" -A 5 -B 5 || true
done

echo
echo "4) Look for the new params key within this repo (may be absent if only in kubeflow repo)"
rg -n 'oauth-proxy-image' || true

echo
echo "5) Detect possibly conflicting/alternate RELATED_IMAGE names for oauth proxy"
rg -n 'RELATED_IMAGE_.*OAUTH.*' || true

Length of output: 3953


Inject OAuth proxy image env var & CSV relatedImages entry

  • File: config/manager/manager.yaml
    Under spec.template.spec.containers[].env, inject the new env var so ApplyParams can substitute it:
    - name: RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE
      value: "${RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE}"
  • File: bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
    (and config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml)
    Add under spec.relatedImages:
     spec:
       relatedImages:
    +  - name: oauth-proxy
    +    image: "${RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE}"
  • Downstream CSV (kubeflow repo) must define oauth-proxy-image in its params.env so the placeholder is populated (pending the linked PR).
  • If the KF Notebook Controller also needs an oauth-proxy override, mirror this oauth-proxyRELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE mapping in its ApplyParams block as well.
🤖 Prompt for AI Agents
In internal/controller/components/workbenches/workbenches.go around lines 55 to
57, you need to inject the OAuth proxy image environment variable and update the
CSV relatedImages entry. Add the env var RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE
with the value placeholder "${RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE}" in
config/manager/manager.yaml under spec.template.spec.containers[].env. Also, add
an entry for oauth-proxy-image under spec.relatedImages in
bundle/manifests/opendatahub-operator.clusterserviceversion.yaml and
config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml. Ensure
the downstream CSV in the kubeflow repo defines oauth-proxy-image in its
params.env for placeholder substitution. If the KF Notebook Controller requires
an oauth-proxy override, add the oauth-proxy to
RELATED_IMAGE_OSE_OAUTH_PROXY_IMAGE mapping in its ApplyParams block as well.

Copy link

codecov bot commented Aug 9, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 41.92%. Comparing base (633bfb8) to head (fc8b591).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...l/controller/components/workbenches/workbenches.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2275      +/-   ##
==========================================
- Coverage   41.92%   41.92%   -0.01%     
==========================================
  Files         144      144              
  Lines       11387    11388       +1     
==========================================
  Hits         4774     4774              
- Misses       6212     6213       +1     
  Partials      401      401              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zdtsw zdtsw marked this pull request as draft August 10, 2025 06:01
@jiridanek
Copy link
Member

/cc @jstourac

@zdtsw
Copy link
Member

zdtsw commented Aug 15, 2025

Please make PR from your own forked git repo's branch, not branch out directly from "origin"

@jstourac
Copy link
Member

The opendatahub-io/kubeflow#671 has been merged and synced all the way through down to the rhds repo. This PR can be resumed and moved on.

@riprasad riprasad marked this pull request as ready for review August 21, 2025 10:14
@openshift-ci openshift-ci bot requested review from asanzgom and ugiordan August 21, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants