Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Newer BOSH releases use a name key, not a final_name key
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Iovanov authored and Sergei Utinski committed Sep 10, 2019
1 parent 67269fa commit 5a1c513
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions model/dev_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ func (r *Release) getDefaultDevReleaseName() (ver string, err error) {
return "", err
}

if value, ok := releaseConfig["final_name"]; !ok {
return "", fmt.Errorf("final_name key did not exist in configuration file for release: %s", r.Path)
if value, ok := releaseConfig["name"]; !ok {
if value, ok := releaseConfig["final_name"]; !ok {
return "", fmt.Errorf("name or final_name key did not exist in configuration file for release: %s", r.Path)
} else if name, ok = value.(string); !ok {
return "", fmt.Errorf("final_name was not a string in release: %s, type: %T, value: %v", r.Path, value, value)
}
} else if name, ok = value.(string); !ok {
return "", fmt.Errorf("final_name was not a string in release: %s, type: %T, value: %v", r.Path, value, value)
return "", fmt.Errorf("name was not a string in release: %s, type: %T, value: %v", r.Path, value, value)
}

return name, nil
Expand Down

0 comments on commit 5a1c513

Please sign in to comment.