Skip to content

Commit

Permalink
refactor(chartify.go): remove oci environment variable
Browse files Browse the repository at this point in the history
Signed-off-by: yxxhero <aiopsclub@163.com>
  • Loading branch information
yxxhero committed Oct 13, 2024
1 parent 532a706 commit 49f3047
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions chartify.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,6 @@ func (r *Runner) copyToTempDir(path, tempDir, chartVersion string) (string, erro
}

func (r *Runner) fetchAndUntarUnderDir(chart, tempDir, chartVersion string) (string, error) {
ociEnv := map[string]string{
"HELM_EXPERIMENTAL_OCI": "1",
}
helmVersionConstraint, _ := semver.NewConstraint(">= 3.7.0")
helmVersion, err := r.DetectHelmVersion()
if err != nil {
Expand All @@ -713,13 +710,13 @@ func (r *Runner) fetchAndUntarUnderDir(chart, tempDir, chartVersion string) (str
helmPullCommand = []string{"chart", "pull", chart}
}

if _, err := r.run(ociEnv, r.helmBin(), helmPullCommand...); err != nil {
if _, err := r.run(map[string]string{}, r.helmBin(), helmPullCommand...); err != nil {
return "", err
}

if !helmVersionConstraint.Check(helmVersion) {
helmExportCommand := []string{"chart", "export", chart, "--destination", tempDir}
if _, err := r.run(ociEnv, r.helmBin(), helmExportCommand...); err != nil {
if _, err := r.run(map[string]string{}, r.helmBin(), helmExportCommand...); err != nil {
return "", err
}
}
Expand Down

0 comments on commit 49f3047

Please sign in to comment.