Skip to content

DownloadGitRepoResources function implementation should also handle variations of other devfile.yaml in its if-block #1362

@maysunfaisal

Description

@maysunfaisal

Which area this feature is related to?

/kind bug

Which area this bug is related to?

/area library

What versions of software are you using?

Go project

Operating System and version:

Go Pkg Version:

Node.js project

Operating System and version:

Node.js version:

Yarn version:

Project.json:

Web browser

Operating System and version:

Browser name and version:

Bug Summary

Describe the bug:

The DownloadGitRepoResources function implementation checks for devfile.yaml,

if !gitUrl.IsFile || gitUrl.Revision == "" || !strings.Contains(gitUrl.Path, OutputDevfileYamlPath) {
	return fmt.Errorf("error getting devfile from url: failed to retrieve %s", url)
}

The function should also handle various other possibilities of devfile.yaml like devfile.yml, .devfile.yaml, .devfile.yml...

To Reproduce:

Expected behavior

Function should be able to handle various devfile naming conventions.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable

Additional context

devfile.yaml has a few naming conventions that is accepted like .devfile.yaml and devfile.yml. They should be considered along side devfile.yaml

Any workaround?

Suggestion on how to fix the bug

Metadata

Metadata

Assignees

Labels

area/libraryCommon devfile library for interacting with devfileskind/bugSomething isn't working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions