Skip to content

fix: better oci handling#18

Merged
bosbaber merged 1 commit into
mainfrom
stephan/20260513-validation
May 13, 2026
Merged

fix: better oci handling#18
bosbaber merged 1 commit into
mainfrom
stephan/20260513-validation

Conversation

@bosbaber
Copy link
Copy Markdown
Contributor

@bosbaber bosbaber commented May 13, 2026

This pull request improves the handling of Helm chart repository URLs by ensuring that scheme-less OCI registry URLs are normalized to use the oci:// scheme, matching the expectations of the Helm CLI and ArgoCD ApplicationSets. It introduces a normalization function, updates the chart rendering logic to use it, and adds comprehensive unit tests to verify the new behavior.

Repository URL normalization:

  • Added a normalizeRepoURL function in utils.go to canonicalize ApplicationSet repoURL values, ensuring that scheme-less OCI registry URLs are prepended with oci://, while existing http://, https://, and oci:// schemes are preserved. This prevents Helm CLI errors and aligns with ArgoCD's behavior.
  • Updated the chart rendering logic in engine_chart_rendering.go to normalize chart.RepoURL before invoking Helm, ensuring consistent handling of repository URLs.

Testing improvements:

  • Added a new test TestNormalizeRepoURL in utils_test.go to cover various input cases for normalizeRepoURL, including empty strings, whitespace, explicit schemes, and scheme-less URLs.
  • Introduced a test TestRenderOCIRepoNoScheme in engine_chart_rendering_test.go to verify that scheme-less OCI URLs are normalized and used correctly in Helm commands during chart rendering.

@bosbaber bosbaber self-assigned this May 13, 2026
@bosbaber bosbaber merged commit 559e07b into main May 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant