Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure chart commands to use helm clients for OCI and private regi… #245

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

ethanchowell
Copy link
Contributor

@ethanchowell ethanchowell commented May 24, 2024

Configure chart commands to use helm clients for OCI and private registry support

Please check below, if the PR fulfills these requirements:

  • Commit(s) and code follow the repositories guidelines.
  • Test(s) have been added or updated to support these change(s).
  • Doc(s) have been added or updated to support these change(s).

Associated Links:

Types of Changes:

This PR extends the chart implementation to use the existing helm install mechanics for chart resolution, primarily to support using OCI references and local repository.yaml configs needed for accessing private registries. With these changes, users can define their chart manifests like

apiVersion: content.hauler.cattle.io/v1alpha1
kind: Charts
metadata:
  name: hauler-content-charts-example
spec:
  charts:
    # fetch helm chart
    - name: rancher
      repoURL: https://releases.rancher.com/server-charts/stable
    - name: rancher
      repoURL: rancher-stable # From `helm repo add rancher-stable https://releases.rancher.com/server-charts/stable`
      version: 2.8.2
    - name: nginx
      repoURL: oci://registry-1.docker.io/bitnamicharts

Proposed Changes:

Verification/Testing of Changes:

Create a chart manifest using oci registries and hauler sync -f oci-hauler.yaml

apiVersion: content.hauler.cattle.io/v1alpha1
kind: Charts
metadata:
  name: hauler-content-charts-example
spec:
  charts:
    - name: nginx
      repoURL: oci://registry-1.docker.io/bitnamicharts

Or with hauler store add chart nginx --repo "oci://registry-1.docker.io/bitnamicharts"

For local repositories resolution create another file using a local repo alias and hauler sync -f aliased-hauler.yaml

apiVersion: content.hauler.cattle.io/v1alpha1
kind: Charts
metadata:
  name: hauler-content-charts-example
spec:
  charts:
    - name: rancher
      repoURL: rancher-stable

or `hauler store add chart rancher --repo rancher-stable

Additional Context:

I recently ran into some issues trying to pull charts from a private registry, which I have a local repositories.yaml file configured for. It makes sense why using the repoURL: https://my-private-repo would 401, but hauler is unable to use the local repositories.yaml config I have which make it difficult to use locally and in CI. Using the helm mechanics though, this config gets read under the hood and as a result picks up OCI support basically for free.

@zackbradys zackbradys added enhancement New feature or request size/M Denotes an issue/PR requiring a relatively moderate amount of work labels May 25, 2024
@zackbradys zackbradys self-assigned this May 28, 2024
Copy link
Member

@zackbradys zackbradys left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @ethanchowell! Great to have folks extending features and functionalities within hauler.

Copy link
Member

@zackbradys zackbradys left a comment

Choose a reason for hiding this comment

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

LGTM!! 👍

@amartin120 amartin120 merged commit 9e95657 into hauler-dev:main Jun 4, 2024
1 check passed
@ethanchowell ethanchowell deleted the ehowell/helm-client branch June 4, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/M Denotes an issue/PR requiring a relatively moderate amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants