Skip to content

Commit

Permalink
Move constant to declaration blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed May 4, 2022
1 parent c45fcd6 commit 54a7951
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion registry-library/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ const (
DevfilePNGLogoMediaType = "image/png"
DevfileArchiveMediaType = "application/x-tar"

OwnersFile = "OWNERS"

httpRequestTimeout = 30 * time.Second // httpRequestTimeout configures timeout of all HTTP requests
responseHeaderTimeout = 30 * time.Second // responseHeaderTimeout is the timeout to retrieve the server's response headers
)

var (
DevfileMediaTypeList = []string{DevfileMediaType}
DevfileAllMediaTypesList = []string{DevfileMediaType, DevfilePNGLogoMediaType, DevfileSVGLogoMediaType, DevfileVSXMediaType, DevfileArchiveMediaType}
ExcludedFiles = []string{OwnersFile}
)

type Registry struct {
Expand Down Expand Up @@ -330,7 +333,7 @@ func PullStackByMediaTypesFromRegistry(registry string, stack string, allowedMed
// Decompress archive.tar
archivePath := filepath.Join(destDir, "archive.tar")
if _, err := os.Stat(archivePath); err == nil {
err := decompress(destDir, archivePath, []string{"OWNERS"})
err := decompress(destDir, archivePath, ExcludedFiles)
if err != nil {
return err
}
Expand Down

0 comments on commit 54a7951

Please sign in to comment.