Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix semantic version check of camel-k-runtime #4731

Closed
wants to merge 1 commit into from

Conversation

claudio4j
Copy link
Contributor

Fix #4715

  • Upgrade semver api to v3
  • kamel version -a relies on loading the catalog using the runtime provider, which is not set in the IntegrationPlatform object, so rendering null and not loading the CamelCatalog object.
  • It may occur the CamelCatalog object is not in the same namespace of the camel-k-operator pod, so we should not print an error message in case the CamelCatalog is not found.
  • In the catalog initialization, print any error related to building the container image in the camel-k-operator log as the error was set only in the CamelCatalog status object.
  • Change the RuntimeVersion type of CamelCatalog object to string, as there may be cases of the runtime version not following the semantic version.
  • The findBestMatch was renamed to findCatalog, since it was not actually trying to match a version rule, but plainly using a full version to check it.

Release Note

Update semver golang api to v3

@github-actions
Copy link
Contributor

🐫 Thank you for contributing!

Code Coverage Report ⚠️ - Coverage changed: 33.1% --> 33.0% (Coverage difference: -.1%)

Copy link
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

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

With this PR we are removing at all the semver logic. The findBestMatch was used when you want to use a catalog which is not exactly known. For instance, running: kamel run test.yaml -t camel.runtime-version=3.x will get the latest 3.x catalog. This is particularly interesting now that we are independent from the runtime. However, we should include this feature in the doc and have an E2E test as well.

@@ -483,6 +483,7 @@ func buildRuntimeBuilderImageSpectrum(options spectrum.Options) error {

_, err := spectrum.Build(options, directories...)
if err != nil {
Log.Error(err, "Error trying to build Camel K builder container")
Copy link
Contributor

Choose a reason for hiding this comment

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

We are returning the error. The caller should know what to do with it, if printing a warning or what else.

@claudio4j
Copy link
Contributor Author

Closing this in favor of #4741

@claudio4j claudio4j closed this Sep 13, 2023
@claudio4j claudio4j deleted the fix_ckr_findcatalog branch October 17, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kamel reports error when trying to use a camel-k-runtime version not following the sematic version
3 participants