Skip to content

Commit f2ec5ef

Browse files
authored
Fix extracting app preflights in v3 airgap installs (#3205)
* Fix extracting app preflights in v3 airgap installs
1 parent 8600c8d commit f2ec5ef

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/helm/client.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,9 @@ func (h *HelmClient) getActionCfg(namespace string, logFn LogFn) (*action.Config
559559

560560
func (h *HelmClient) loadChart(ctx context.Context, releaseName, chartPath, chartVersion string) (*chart.Chart, error) {
561561
var localPath string
562-
if h.airgapPath != "" {
562+
if _, err := os.Stat(chartPath); err == nil {
563+
localPath = chartPath
564+
} else if h.airgapPath != "" {
563565
// airgapped, use chart from airgap path
564566
// TODO: this should just respect the chart path if it's a local path and leave it up to the caller to handle
565567
localPath = filepath.Join(h.airgapPath, fmt.Sprintf("%s-%s.tgz", releaseName, chartVersion))
@@ -572,8 +574,10 @@ func (h *HelmClient) loadChart(ctx context.Context, releaseName, chartPath, char
572574
return nil, fmt.Errorf("pull: %w", err)
573575
}
574576
defer os.RemoveAll(localPath)
575-
} else {
576-
localPath = chartPath
577+
}
578+
579+
if localPath == "" {
580+
return nil, fmt.Errorf("chart path not found: %s", chartPath)
577581
}
578582

579583
chartRequested, err := loader.Load(localPath)

0 commit comments

Comments
 (0)