Skip to content

Commit

Permalink
Revert "Use GHCR for Radius Helm repository" (#6698)
Browse files Browse the repository at this point in the history
Reverts #6672

Signed-off-by: Karishma Chawla <[email protected]>
Co-authored-by: Karishma Chawla <[email protected]>
  • Loading branch information
sk593 and kachawla authored Nov 11, 2023
1 parent c07fa0e commit 6a4c730
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
29 changes: 2 additions & 27 deletions pkg/cli/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/helm/radiusclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down

0 comments on commit 6a4c730

Please sign in to comment.