Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

✨ Support extenion compat with addon as regex. #782

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Feb 11, 2025

Both the analyzer and tech-discovery both use the same providers. An extension having compatibility with multiple addons is not a common/mainstream use case. To get around this, we have defined a duplicate set of extensions for each provider. One with compatibility with the analyzer addon and the other for the tech-discovery addon.

After a recent refactor of the generic extension into multiple extensions (go, python, nodejs), it became obvious that maintain the duplicate set of extensions is painful and likely error prone.

It seems a better approach is to change Extention.Spec.Addon to (optionally) define a regex. This approach caters to the mainstream use case that extensions have compatibility with one addon. It also avoids making the field an array requiring a CRD change. This is which is MUCH simpler.

The existing extensions will need to be updated to be compatible with both addons.
Example (java extension):

addon: ^(analyzer|tech-discovery)$

The discovery- extensions would be deleted.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
@@ -368,6 +368,7 @@ func (r *Hub) namespace() (ns string, err error) {
// build returns the hub build version.
// This is expected to be the output of `git describe`.
// Examples:
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hint: ^ added by gofmt.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
Copy link
Member

@aufi aufi left a comment

Choose a reason for hiding this comment

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

Looks great 👍

@jortel jortel merged commit 6627a2d into konveyor:main Feb 12, 2025
13 checks passed
jortel added a commit that referenced this pull request Feb 12, 2025
Missed a validation in #782.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants