Skip to content

Add secrets for helm upgrade#16432

Draft
sowmya-sl wants to merge 8 commits into
openshift:mainfrom
sowmya-sl:add-secrets-for-helm-upgrade
Draft

Add secrets for helm upgrade#16432
sowmya-sl wants to merge 8 commits into
openshift:mainfrom
sowmya-sl:add-secrets-for-helm-upgrade

Conversation

@sowmya-sl
Copy link
Copy Markdown
Contributor

Analysis / Root cause:

Solution description:

Screenshots / screen recording:

Test setup:

Test cases:

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:

sowmya-sl added 5 commits May 1, 2026 15:37
- Add basicAuthSecretName parameter to GetChartFromURL and InstallChartFromURL
- Build RegistryClient with basic auth credentials for OCI registry pulls
- Extract shared registryClientOptions from GetOCIRegistry for reuse
- Add applyBasicAuthFromSecret helper to read credentials from K8s Secret
- Strip OCI version tags before LocateChart to prevent duplicate tag errors
- Wire basic_auth_secret_name through HandleChartGet and HandleHelmInstallAsync
- Add OCI basic auth test cases with zot registry and htpasswd auth
    - Add typeahead secret dropdown to HelmURLChartForm
    - Surface errors for invalid secrets with explanatory description
    - Pass basicAuthSecretName through fetchChartData and install API calls
    - Append namespace and basic_auth_secret_name to chart fetch query string
    - Display selected secret as read-only field on the install confirmation step
    - Add basicAuthSecretName to HelmURLChartFormData type and helm-utils
…stallForm

- Remove stale useTheme import that caused TS6133 build error
- Drop theme property from useHelmReadmeModalLauncher (not in Props type)
- Pass namespace to HelmURLInstallForm for ResourceDropdownField
Move the empty-secret-name guard from applyBasicAuthFromSecret to its
call sites in InstallChartFromURL and GetChartFromURL so the function
can assume it always has work to do. Add test cases for missing secrets,
malformed secrets (missing username/password keys), and wrong credentials
over both OCI and HTTP. Replace exact error string matching with
ErrorContains for more resilient assertions.
@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 May 12, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 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 openshift-ci Bot added the component/backend Related to backend label May 12, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 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 component/helm Related to helm-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels May 12, 2026
@sowmya-sl sowmya-sl force-pushed the add-secrets-for-helm-upgrade branch from f474e13 to 424549f Compare May 12, 2026 08:17
sowmya-sl added 2 commits May 12, 2026 22:28
Decouple GetOCIRegistry from action.Configuration so it returns the
registry client directly, keeping GetActionConfigurations focused on
REST/namespace plumbing. Consolidate secret-based auth into
GetUserCredentials and applyBasicAuthFromUserCredentials for reuse across
InstallChartFromURL and GetChartFromURL. Extract duplicated secret-
watching logic from HelmURLChartForm and HelmURLInstallForm into a
shared useSecretResources hook. Add test coverage for UserCredentials
in GetOCIRegistry.
…ll form

The second page (install form) shows the secret field as disabled. When
no secret is selected, display "None" instead of "Select a secret" to
clearly indicate that authentication is not configured.
@sowmya-sl sowmya-sl force-pushed the add-secrets-for-helm-upgrade branch from 424549f to c2dac6d Compare May 14, 2026 13:07
Use a RegistryClientSetter interface so applyBasicAuthFromUserCredentials
works with both action.Install and action.Upgrade via their shared
ChartPathOptions. Persist the basic-auth secret name as a chart
annotation (helm.openshift.io/auth-secret) during install and propagate
it on upgrade so authenticated registries remain accessible across the
release lifecycle.
@sowmya-sl sowmya-sl force-pushed the add-secrets-for-helm-upgrade branch from c2dac6d to 92da9e3 Compare May 15, 2026 14:03
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 component/helm Related to helm-plugin do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant