Skip to content

Commit

Permalink
Use sourceImageURI for packages Helm chart modifications (#8469)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Jul 11, 2024
1 parent a5bb950 commit 706672e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions release/cli/pkg/bundles/package-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,12 @@ func GetPackagesBundle(r *releasetypes.ReleaseConfig, imageDigests releasetypes.
return anywherev1alpha1.PackageBundle{}, errors.Wrap(err, "creating helm client")
}
fmt.Printf("Modifying helm chart for %s\n", trimmedAsset)
helmDest, err := helm.GetHelmDest(helmDriver, r, imageArtifact.ReleaseImageURI, trimmedAsset)
helmDest, err := helm.GetHelmDest(helmDriver, r, imageArtifact.SourceImageURI, trimmedAsset)
if err != nil {
return anywherev1alpha1.PackageBundle{}, errors.Wrap(err, "getting Helm destination:")
}
fmt.Printf("helmDest=%v\n", helmDest)
fmt.Printf("Pulled helm chart locally to %s\n", helmDest)
fmt.Printf("r.sourceClients")
err = helm.ModifyAndPushChartYaml(*imageArtifact, r, helmDriver, helmDest, packagesArtifacts, bundleImageArtifacts)
if err != nil {
return anywherev1alpha1.PackageBundle{}, errors.Wrap(err, "modifying Chart.yaml and pushing Helm chart to destination:")
Expand Down
6 changes: 3 additions & 3 deletions release/cli/pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewHelm() (*helmDriver, error) {
}, nil
}

func GetHelmDest(d *helmDriver, r *releasetypes.ReleaseConfig, ReleaseImageURI, assetName string) (string, error) {
func GetHelmDest(d *helmDriver, r *releasetypes.ReleaseConfig, sourceImageURI, assetName string) (string, error) {
var chartPath string
var err error

Expand All @@ -75,9 +75,9 @@ func GetHelmDest(d *helmDriver, r *releasetypes.ReleaseConfig, ReleaseImageURI,
return "", fmt.Errorf("logging into the source registry: %w", err)
}

helmChart := strings.Split(ReleaseImageURI, ":")
helmChart := strings.Split(sourceImageURI, ":")
fmt.Printf("Starting to modifying helm chart %s\n", helmChart[0])
fmt.Printf("Pulling helm chart %s\n", ReleaseImageURI)
fmt.Printf("Pulling helm chart %s\n", sourceImageURI)
chartPath, err = d.PullHelmChart(helmChart[0], helmChart[1])
if err != nil {
return "", fmt.Errorf("pulling the helm chart: %w", err)
Expand Down

0 comments on commit 706672e

Please sign in to comment.