Description
/kind bug
Which area this bug is related to?
/area registry
What versions of software are you using?
Operating System: Linux
Go Pkg Version: 1.18
Bug Summary
Describe the bug:
Downloading starter projects using the Registry Library causes an error if the host url contains a /
at the end of it, for example https://registry.devfile.io/
would cause this error but https://registry.devfile.io
would work fine.
To Reproduce:
CLI:
go build && ./registry-library download https://registry.devfile.io/ nodejs nodejs-starter
Library Import:
registryURL := "https://registry.devfile.io/"
bytes, err := registryLibrary.DownloadStarterProjectAsBytes(registryURL,
stack, starterProject, options)
if err != nil {
return err
}
Expected behavior
Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable.
failed to download starter project nodejs-starter: error opening downloaded starter project archive: zip: not a valid zip file
Additional context
Any workaround?
In the case of the above steps to reproduce, use:
go build && ./registry-library download https://registry.devfile.io nodejs nodejs-starter
Suggestion on how to fix the bug
library/library.go#L426 should be changed to prevent a bad join.
Target Date: 07-21-2022