Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

feat: devfile detection implemented in go #55

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

lstocchi
Copy link
Collaborator

@lstocchi lstocchi commented Jan 11, 2022

This adds the basic devfile detection we have in java. It takes a list of devfile and return the one that matches the most.

@kadel for your use case do you prefer to send a registry url to alizer and receive the selected devfile or you will use this method (sending a list of devfiles and have the one that matches the most returned)?

@lstocchi lstocchi linked an issue Jan 12, 2022 that may be closed by this pull request
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
@lstocchi lstocchi marked this pull request as ready for review January 26, 2022 08:44
@lstocchi lstocchi requested review from jeffmaury and kadel January 26, 2022 08:45
Copy link
Member

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect nil, err to be used when an error is detected but I'm not a Go expert

go/pkg/apis/recognizer/devfile_recognizer.go Show resolved Hide resolved
@lstocchi
Copy link
Collaborator Author

I would expect nil, err to be used when an error is detected but I'm not a Go expert

Based on my short exp with go it seems the important thing is the error as that is used for checking. So nil or an empty struct is the same. WDYT? @kadel

@kadel
Copy link
Member

kadel commented Feb 3, 2022

@kadel for your use case do you prefer to send a registry url to alizer and receive the selected devfile or you will use this method (sending a list of devfiles and have the one that matches the most returned)?

To be honest, I'm not sure right now. I would say that the way how it is right now is fine. If we need something smarter that needs to communicate with the registry we can build it on top of this

@lstocchi lstocchi merged commit 71bf447 into redhat-developer:main Feb 3, 2022
@lstocchi lstocchi deleted the goDevfileDetection branch February 3, 2022 15:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add devfile selection in go
3 participants