Skip to content

Commit

Permalink
Bug fix validate.go (openconfig#3598)
Browse files Browse the repository at this point in the history
* Bug fix validate.go

Current code only works if a string is passed as the version.  If no string is provided, the a clone is attempted on a branch name of "v", which won't exist in the public OC repo

* Update validate.go

* trim ws

* fix static check
  • Loading branch information
dplore authored Nov 19, 2024
1 parent fd12118 commit db50408
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/nosimage/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ func main() {
if err := os.MkdirAll(config.DownloadPath, 0750); err != nil {
fmt.Println(fmt.Errorf("cannot create download path directory: %v", config.DownloadPath))
}
publicPath, err := ocpaths.ClonePublicRepo(config.DownloadPath, "v"+profile.Ocpaths.GetVersion())

ocReleaseTag := ""
if profile.Ocpaths.GetVersion() != "" {
ocReleaseTag = "v" + profile.Ocpaths.GetVersion()
}
publicPath, err := ocpaths.ClonePublicRepo(config.DownloadPath, ocReleaseTag)
if err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down

0 comments on commit db50408

Please sign in to comment.