Skip to content

Split helm_import_repository into different rules per source type #195

@zachburg

Description

@zachburg

Right now, helm_import_repository supports three different use cases:

  • Downloading a chart from the specified HTTP URL
  • Finding a chart in a HTTP repository
    • Note that index.yaml may provide a oci:// URL here
  • Downloading a chart from an OCI registry

Two issues discovered here:

  1. No support for specifying by digest instead of version tag for OCI URLs:

    oci://registry-1.docker.io/bitnamicharts/grafana@sha256:015f66a231a809557ab368d903f6762ba31ba2f7b3d0f890445be6e8f213cff1

    This is not valid in helm though, helm requires specifying tag in the URL or setting the --version flag.

  2. Can't always determine version from URL:

    aws-cluster-autoscaler-1.2.3-rc.tgz is a possible chart package file name (Ref: https://helm.sh/docs/chart_best_practices/conventions/#chart-names), but there's no clear way to separate the version (1.2.3-rc) from the name of aws-cluster-autoscaler.

I propose splitting helm_import_repository into three different rules:

  • helm_import_url to import a chart from a HTTP URL
  • helm_import_repository to import a chart from a HTTP repository by finding it in index.yaml
  • helm_import_registry to import a chart from an OCI registry.

Splitting into separate rules will make it easier to manage the code and avoid the issues mentioned earlier.

Unfortunately, this would be a breaking change for current users. @abrisco, thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions