Skip to content

Commit

Permalink
fix: Surface file not exist error
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 committed Jun 20, 2024
1 parent 0eee8b4 commit f9a2397
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/wsm/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ func DeployCmd() *cobra.Command {
}

if bundlePath != "" {
if _, err := os.Stat(bundlePath); os.IsNotExist(err) {
fmt.Printf("Bundle path %s does not exist\n", bundlePath)
os.Exit(1)
}

chartPath, err = utils.PathFromDir(bundlePath+"/charts", helm.WandbChart)
if err != nil {
fmt.Println("Error finding wandb chart:", err)
Expand All @@ -181,6 +186,13 @@ func DeployCmd() *cobra.Command {

vals := specToApply.Values
operatorVals := values.Values{}
if valuesPath != "" {
if _, err := os.Stat(valuesPath); os.IsNotExist(err) {
fmt.Printf("Values file %s does not exist\n", valuesPath)
os.Exit(1)
}
}

if localVals, err := values.FromYAMLFile(valuesPath); err == nil {
if _, ok := localVals["wandb"]; ok {
vals, err = values.Values(localVals["wandb"].(map[string]interface{})).Merge(vals)
Expand Down

0 comments on commit f9a2397

Please sign in to comment.