Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starter Project downloading under Registry Library causes error when registry base url ends with a / #895

Closed
michael-valdron opened this issue Jul 19, 2022 · 0 comments · Fixed by devfile/registry-support#128
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working
Projects

Comments

@michael-valdron
Copy link
Member

michael-valdron commented Jul 19, 2022

/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

@michael-valdron michael-valdron added this to Under consideration in Sprint 221 via automation Jul 19, 2022
@michael-valdron michael-valdron self-assigned this Jul 19, 2022
@openshift-ci openshift-ci bot added kind/bug Something isn't working area/registry Devfile registry for stacks and infrastructure labels Jul 19, 2022
@michael-valdron michael-valdron moved this from Under consideration to In progress in Sprint 221 Jul 19, 2022
@michael-valdron michael-valdron changed the title registry download under Registry Library returns error when registry base url ends with a / Starter Project downloading under Registry Library returns error when registry base url ends with a / Jul 19, 2022
@michael-valdron michael-valdron moved this from In progress to Review in progress in Sprint 221 Jul 19, 2022
@michael-valdron michael-valdron changed the title Starter Project downloading under Registry Library returns error when registry base url ends with a / Starter Project downloading under Registry Library causes error when registry base url ends with a / Jul 19, 2022
@johnmcollier johnmcollier removed this from Review in progress in Sprint 221 Jul 21, 2022
@johnmcollier johnmcollier added this to Under consideration in Sprint 222 via automation Jul 21, 2022
@johnmcollier johnmcollier moved this from Under consideration to Review in progress in Sprint 222 Jul 21, 2022
Sprint 222 automation moved this from Review in progress to Done Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working
Projects
No open projects
1 participant