Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Check that chart exists when updating its deps #1606

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Check that chart exists when updating its deps
We don't want to fail at updating chart dependencies when a chart
doesn't have a requirements.yaml file (which is optional, for a
chart). However, we _do_ want to fail if the chart doesn't exist in
the filesystem at all.
  • Loading branch information
squaremo committed Dec 17, 2018
commit af2b1096aa22091d680855afd30bd54006b04909
9 changes: 9 additions & 0 deletions integrations/helm/chartsync/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import (
func updateDependencies(chartDir, helmhome string) error {
var hasLockFile bool

// sanity check: does the chart directory exist
chartInfo, err := os.Stat(chartDir)
switch {
case err != nil:
return err
case !chartInfo.IsDir():
return fmt.Errorf("chart path %s is not a directory", chartDir)
}

// check if the requirements file exists
reqFilePath := filepath.Join(chartDir, "requirements.yaml")
reqInfo, err := os.Stat(reqFilePath)
Expand Down