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

    • Added OCI registry integration with configurable TLS verification and plain-HTTP options.
  • Improvements

    • Registry client is now initialized during configuration; failures are logged at debug level but do not prevent operation.
  • Tests

    • Added tests covering registry initialization success, nil-configuration errors, option combinations, and client-creation error handling.

✏️ 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 client initialization to Helm action configurations: new GetDefaultOCIRegistry and GetOCIRegistry functions with TLS and plain-HTTP options; config initialization now invokes GetDefaultOCIRegistry and logs debug-level errors without changing control flow.

Changes

Cohort / File(s) Summary
OCI Registry Implementation
pkg/helm/actions/get_registry.go
Adds GetDefaultOCIRegistry and GetOCIRegistry(conf, skipTLSVerify, plainHTTP) to create and assign a registry client on *action.Configuration; validates non-nil config, configures plainHTTP and InsecureSkipVerify via transport, wraps creation errors, and exposes newRegistryClient test hook.
Config Integration
pkg/helm/actions/config.go
Calls GetDefaultOCIRegistry(conf) after action configuration init; logs a debug message on error and continues; no change to returned value or control flow.
OCI Registry Test Suite
pkg/helm/actions/get_registry_test.go
Adds unit tests covering success, nil-config error, TLS/plainHTTP combinations (table-driven), and client-creation error handling; uses mocked newRegistryClient, in-memory storage, and fake Kubernetes clients.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 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 accurately summarizes the main change: adding OCI registry client support for Helm chart operations, directly addressing the core problem of failing OCI-based chart installations.

✏️ 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 component/backend Related to backend approved Indicates a PR has been approved by an approver from all required OWNERS files. labels 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")
}

@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.

@sowmya-sl
Copy link
Contributor Author

/retest

webbnh

This comment was marked as resolved.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 21, 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

  • Automatically fetches and initializes the OCI registry before Helm operations (install, upgrade, chart fetch, rollback), improving pre-validation and reliability.

  • Handlers now return clear Bad Gateway-style errors when registry retrieval fails.

  • Tests

  • Added tests for successful registry initialization, nil-configuration handling, various TLS/HTTP option combinations, and client-creation error paths 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.

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 29-36: When skipTLSVerify is true, don't create a bare
http.Transport (which loses ProxyFromEnvironment and default timeouts/HTTP2
settings); instead clone the default transport, assert
http.DefaultTransport.(*http.Transport), call Clone() to get a copy, set its
TLSClientConfig.InsecureSkipVerify = true, and use that cloned transport in the
http.Client passed to registry.ClientOptHTTPClient so Proxy and other default
behaviors are preserved.

webbnh

This comment was marked as resolved.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 23, 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

Release Notes

  • New Features

  • Added OCI registry integration with configurable security settings including TLS verification and HTTP options

  • Improvements

  • Enhanced registry initialization with robust error handling—system logs debug messages and continues operating on failures

  • Tests

  • Added comprehensive test coverage for registry initialization scenarios, error handling, and configuration variations

✏️ 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.

- Remove getDefaultRegistryClient from helm handler file.
- 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 23, 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

  • Added OCI registry integration with configurable TLS verification and plain-HTTP options.

  • Improvements

  • Registry client is now initialized during configuration; failures are logged at debug level but do not prevent operation.

  • Tests

  • Added tests covering registry initialization success, nil-configuration errors, option combinations, and client-creation 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

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

@sowmya-sl, this looks good to me. However, I did have one late-breaking thought which you might want to consider before letting this merge (or, maybe you'll want to take it up in a follow-on PR, with my other suggestion).

/lgtm

Comment on lines 52 to +56
conf.Init(confFlags, ns, "secrets", klog.Infof)

err = GetDefaultOCIRegistry(conf)
if err != nil {
klog.V(4).Infof("Failed to get default OCI registry: %v", err)
}
Copy link

Choose a reason for hiding this comment

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

My apologies, @sowmya-sl, but I didn't fully appreciate what you had accomplished here!

So, I now have to ask: why implement GetDefaultOCIRegistry() as a separate function, or, more to the point, why call it from here? Why not in-line or call it inside conf.Init()?

Also, as an aside (since it's arguably outside the scope of this PR), my IDE notes that the code is ignoring the error returned by conf.Init(). 😞 We should probably not be doing that -- instead, the code should be returning nil (and maybe an error) and letting the caller address the situation. But, I don't know if you're up for trying to fix that, now (it affects a dozen callers, as you presumably know well).

Comment on lines 123 to 125
if err != nil {
serverutils.SendResponse(w, http.StatusBadGateway, serverutils.ApiError{Err: fmt.Sprintf("Failed to get default registry: %v", err)})
return
Copy link

Choose a reason for hiding this comment

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

As I noted elsewhere, there is a problem inside getActionConfigurations() in that it is ignoring errors from conf.Init() and still returning the configuration. But, my instinct is that addressing that will become a substantial effort which is outside the scope this PR.

But, yes, I would support another PR which checks for errors from conf.Init(), adds an error return from getActionConfigurations(), and modifies each of the dozen callers to handle errors appropriately. And, in the context of that code change, you could add appropriate unit testing for each of those callers which tests all of their respective error cases, which would address some of our technical debt here.

Comment on lines 77 to 81
for _, tt := range tests {
originalNewRegistryClient := newRegistryClient
defer func() {
newRegistryClient = originalNewRegistryClient
}()
Copy link

Choose a reason for hiding this comment

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

We are not running the tests in parallel (via invoking t.Parallel()). So we should not see this.

In fact, we need to avoid running the tests in parallel, because the mock uses values from the loop iterator, so it is critical that the mock for a given iteration be the one used by the test in that iteration.

we are not using a global mock

But we actually are: the CUT is accessing the mocked function via a global reference; if one iteration of the test changes the value of that reference, then that value will be visible to the other iterations of the test (unless they also change it). So, as long as we run the iterations serially, everything should be fine (because each CUT will see its iteration's mock); however, if we were to run them in parallel, then it is likely that some of them would use the wrong mock and wouldn't be able to pass the test (but, the behavior would be non-deterministic, which makes it worse).

@webbnh
Copy link

webbnh commented Jan 23, 2026

/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 23, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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
Copy link
Contributor

openshift-ci bot commented Jan 24, 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 f7030e3 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.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants