Skip to content

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

Closed
devfile/registry-support
#128
@michael-valdron

Description

@michael-valdron

/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

Metadata

Metadata

Labels

area/registryDevfile registry for stacks and infrastructurekind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions