Skip to content

Zip archive links without .zip extension are invalid when using GetAndExtractZip #796

Closed
@michael-valdron

Description

@michael-valdron

/kind bug

Which area this bug is related to?

/area library
/area registry

What versions of software are you using?

Operating System: N/A

Go Pkg Version: github.com/devfile/library v1.2.1-0.20220215173721-fc8a5b4f2768

Bug Summary

Describe the bug:

Validation check for if the link contains a .zip extension fails if the link produces server side redirects, problem check can be seen here: https://github.com/devfile/library/blob/0f5995513e920153b646a2ff8743a029ad937876/pkg/util/util.go#L848

To Reproduce:

This can be produced by using GetAndExtractZip on the Quarkus Java link: https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile

Expected behavior

Fixing this issue will allow the GetAndExtractZip function to download and extract zip files from links which do not have to .zip extension directly in them.

Additional context

Suggestion on how to fix the bug

Removing this check seems to be the only way to remove this problem.

Metadata

Metadata

Labels

area/libraryCommon devfile library for interacting with devfilesarea/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