Skip to content

Conversation

@sowmya-sl
Copy link
Contributor

@sowmya-sl sowmya-sl commented Jan 16, 2026

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611
Original PR on #15830

Steps to test:

  1. Create a helmrepository object in the cluster. The helmrepository object can be either cluster or namespaced, it does not matter.
  2. Add repo link as https://charts.bitnami.com/bitnami . Bitnami has many OCI helm charts.
  3. Once added, go to Releases and create a Helm release.
  4. Sort by the newly added bitnami repository. Select nginx as the chart.
  5. Click on create. Wait for the release to create and verify when created.

Summary by CodeRabbit

  • New Features

    • OCI registry is now fetched automatically before Helm operations (install, upgrade, chart fetch), improving reliability and pre-validating registry access.
    • Handlers now surface clear error responses if registry retrieval fails.
  • Tests

    • Added tests covering successful registry initialization, nil-configuration errors, and client-creation failures to ensure robust behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

OCI-based Helm charts were failing to install because the action
configuration lacked a registry client. This change:

- Add GetDefaultOCIRegistry() to create and attach a registry client
  to the Helm action configuration
- Integrate registry client initialization into all Helm handlers:
  install, upgrade, uninstall, rollback, and chart get operations
- Add unit tests for the new registry client function
- Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail
with errors about missing registry support.

Fixes: HELM-611
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 16, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 16, 2026
@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 Jan 16, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 16, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Walkthrough

Adds OCI registry initialization utilities and integrates a default OCI registry retrieval into Helm action configuration and HTTP handlers. New functions create and assign a registry client to action configurations; handlers invoke this retrieval and may short-circuit on failure. Tests and a test seam for client creation were added.

Changes

Cohort / File(s) Summary
OCI Registry Utilities
pkg/helm/actions/get_registry.go, pkg/helm/actions/get_registry_test.go
Adds GetDefaultOCIRegistry(conf *action.Configuration) error and GetOCIRegistry(conf *action.Configuration, skipTLSVerify bool, plainHTTP bool) error. Builds registry client options, supports plain HTTP and skip-tls, assigns client to conf.RegistryClient. Includes tests for success, nil-config error, and client-creation error; introduces a package-level test seam (newRegistryClient) for mocking.
Config Initialization
pkg/helm/actions/config.go
After initializing Helm action conf, calls GetDefaultOCIRegistry(conf) and logs debug-level errors on failure; does not change the returned conf on error.
Handler Integration
pkg/helm/handlers/handlers.go, pkg/helm/handlers/handler_test.go
Adds getDefaultOCIRegistry func(*action.Configuration) error to helmHandlers, wired to actions.GetDefaultOCIRegistry in New. Pre-invokes this hook in seven handlers (Install, InstallAsync, ChartGet, UpgradeRelease, UpgradeReleaseAsync, RollbackRelease, GetChart); handlers return Bad Gateway if the hook fails. Tests updated with a no-op test double for the hook.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding OCI registry client support to Helm operations for chart handling.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci openshift-ci bot added the component/backend Related to backend label Jan 16, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sowmya-sl

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 16, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611
Original PR on #15830

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@sowmya-sl sowmya-sl marked this pull request as ready for review January 20, 2026 10:18
@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 Jan 20, 2026
@openshift-ci openshift-ci bot requested review from baijum and martinszuc January 20, 2026 10:19
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 20, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611
Original PR on #15830

Steps to test:

  1. Create a helmrepository object in the cluster. The helmrepository object can be either cluster or namespaced, it does not matter.
  2. Add repo link as https://charts.bitnami.com/bitnami . Bitnami has many OCI helm charts.
  3. Once added, go to Releases and create a Helm release.
  4. Sort by the newly added bitnami repository. Select nginx as the chart.
  5. Click on create. Wait for the release to create and verify when created.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 20, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611
Original PR on #15830

Steps to test:

  1. Create a helmrepository object in the cluster. The helmrepository object can be either cluster or namespaced, it does not matter.
  2. Add repo link as https://charts.bitnami.com/bitnami . Bitnami has many OCI helm charts.
  3. Once added, go to Releases and create a Helm release.
  4. Sort by the newly added bitnami repository. Select nginx as the chart.
  5. Click on create. Wait for the release to create and verify when created.

Summary by CodeRabbit

  • New Features

  • OCI registry is now automatically initialized when performing Helm operations such as installation, upgrades, and chart retrieval.

  • Enhanced error handling provides descriptive feedback when registry configuration fails.

  • Tests

  • Added comprehensive test coverage for OCI registry initialization and error handling.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

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

🤖 Fix all issues with AI agents
In `@pkg/helm/actions/get_registry.go`:
- Around line 17-26: GetOCIRegistry currently ignores insecure and plainHTTP;
fix by passing registry.ClientOptPlainHTTP() when plainHTTP is true, and handle
insecure by constructing an *http.Client with a custom
tls.Config{InsecureSkipVerify: true} and passing it to newRegistryClient via
registry.ClientOptHTTPClient(httpClient); update GetOCIRegistry to call
newRegistryClient with the appropriate options (plainHTTP and/or HTTP client)
and add imports for crypto/tls and net/http so the custom HTTP client can be
created and supplied to the registry client.
🧹 Nitpick comments (2)
pkg/helm/actions/config.go (1)

53-56: Redundant registry initialization across config and handlers.

This call to GetDefaultOCIRegistry is non-blocking (logs and continues), while handlers.go calls the same function and does fail the request on error. The redundancy means the registry client may be initialized twice per request when the first call succeeds.

Consider removing this call from config initialization since handlers.go already performs the authoritative check with proper error handling. If the intent is a "best-effort early init," the pattern is fine but should be documented.

pkg/helm/handlers/handler_test.go (1)

205-207: Consider adding test coverage for registry initialization failures.

The fake always returns nil, which is fine for happy-path testing. However, since handlers now return BadGateway when getDefaultOCIRegistry fails, consider adding at least one test case that injects a failing getDefaultOCIRegistry to verify the error response path.

func fakeGetDefaultOCIRegistryError(conf *action.Configuration) error {
    return errors.New("mock registry error")
}

- Rename insecure param to skipTLSVerify for clarity
- Add TLS skip verification and plainHTTP support
- Use mockable newRegistryClient for testability
- Fix variable naming (registryClient)
- Return nil directly instead of err variable
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 20, 2026

@sowmya-sl: This pull request references HELM-611 which is a valid jira issue.

Details

In response to this:

OCI-based Helm charts were failing to install because the action configuration lacked a registry client. This change:

  • Add GetDefaultOCIRegistry() to create and attach a registry client to the Helm action configuration
  • Integrate registry client initialization into all Helm handlers: install, upgrade, uninstall, rollback, and chart get operations
  • Add unit tests for the new registry client function
  • Update older tests to use mock registry Client function

Without a registry client, operations on OCI charts (oci://) would fail with errors about missing registry support.

Fixes: HELM-611
Original PR on #15830

Steps to test:

  1. Create a helmrepository object in the cluster. The helmrepository object can be either cluster or namespaced, it does not matter.
  2. Add repo link as https://charts.bitnami.com/bitnami . Bitnami has many OCI helm charts.
  3. Once added, go to Releases and create a Helm release.
  4. Sort by the newly added bitnami repository. Select nginx as the chart.
  5. Click on create. Wait for the release to create and verify when created.

Summary by CodeRabbit

  • New Features

  • OCI registry is now fetched automatically before Helm operations (install, upgrade, chart fetch), improving reliability and pre-validating registry access.

  • Handlers now surface clear error responses if registry retrieval fails.

  • Tests

  • Added tests covering successful registry initialization, nil-configuration errors, and client-creation failures to ensure robust behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 20, 2026

@sowmya-sl: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 8ebc6b6 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@sowmya-sl
Copy link
Contributor Author

/retest

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/backend Related to backend jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants