From 6a4c73049d254abd64e39efe845465d088cc99bb Mon Sep 17 00:00:00 2001 From: Shruthi Kumar Date: Fri, 10 Nov 2023 16:20:02 -0800 Subject: [PATCH] Revert "Use GHCR for Radius Helm repository" (#6698) Reverts radius-project/radius#6672 Signed-off-by: Karishma Chawla Co-authored-by: Karishma Chawla --- pkg/cli/helm/helm.go | 29 ++--------------------------- pkg/cli/helm/radiusclient.go | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/pkg/cli/helm/helm.go b/pkg/cli/helm/helm.go index 34cc524fc4..1ac7f38d44 100644 --- a/pkg/cli/helm/helm.go +++ b/pkg/cli/helm/helm.go @@ -29,7 +29,6 @@ import ( "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" "helm.sh/helm/v3/pkg/cli" - "helm.sh/helm/v3/pkg/registry" "k8s.io/cli-runtime/pkg/genericclioptions" ) @@ -80,6 +79,7 @@ func locateChartFile(dirPath string) (string, error) { func helmChartFromContainerRegistry(version string, config *helm.Configuration, repoUrl string, releaseName string) (*chart.Chart, error) { pull := helm.NewPull() + pull.RepoURL = repoUrl pull.Settings = &cli.EnvSettings{} pullopt := helm.WithConfig(config) pullopt(pull) @@ -101,32 +101,7 @@ func helmChartFromContainerRegistry(version string, config *helm.Configuration, pull.DestDir = dir - var chartRef string - - if !registry.IsOCI(repoUrl) { - // For non-OCI registries (like contour), we need to set the repo URL - // to the registry URL. The chartRef is the release name. - // ex. - // pull.RepoURL = https://charts.bitnami.com/bitnami - // pull.Run("contour") - pull.RepoURL = repoUrl - chartRef = releaseName - } else { - // For OCI registries (like radius), we will use the - // repo URL + the releaseName as the chartRef. - // pull.Run("oci://ghcr.io/radius-project/helm-chart/radius") - chartRef = fmt.Sprintf("%s/%s", repoUrl, releaseName) - - // Since we are using an OCI registry, we need to set the registry client - registryClient, err := registry.NewClient() - if err != nil { - return nil, err - } - - pull.SetRegistryClient(registryClient) - } - - _, err = pull.Run(chartRef) + _, err = pull.Run(releaseName) if err != nil { return nil, fmt.Errorf("error downloading helm chart from the registry for version: %s, release name: %s. Error: %w", version, releaseName, err) } diff --git a/pkg/cli/helm/radiusclient.go b/pkg/cli/helm/radiusclient.go index 7087b3bb18..41a59b362e 100644 --- a/pkg/cli/helm/radiusclient.go +++ b/pkg/cli/helm/radiusclient.go @@ -33,7 +33,7 @@ import ( const ( radiusReleaseName = "radius" - radiusHelmRepo = "oci://ghcr.io/radius-project/helm-chart" + radiusHelmRepo = "https://radius.azurecr.io/helm/v1/repo" RadiusSystemNamespace = "radius-system" )