This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new b1c628268 Fix operator check of the catalog
b1c628268 is described below
commit b1c6282686017d10b0683b149e7c656277e9777c
Author: Claudio Miranda <[email protected]>
AuthorDate: Wed Sep 13 19:26:04 2023 -0300
Fix operator check of the catalog
Fix https://github.com/apache/camel-k/issues/4715
* When there is a catalog build error, show in the operator log
* Only prints catalog information when it's available
---
pkg/cmd/version.go | 16 ++++------------
pkg/controller/catalog/initialize.go | 1 +
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go
index ee2ac2523..4cc93085c 100644
--- a/pkg/cmd/version.go
+++ b/pkg/cmd/version.go
@@ -19,7 +19,6 @@ package cmd
import (
"context"
- "errors"
"fmt"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
@@ -153,19 +152,12 @@ func operatorInfo(ctx context.Context, c client.Client,
namespace string) (map[s
if err != nil {
return nil, err
}
- if catalog == nil {
- msg := fmt.Sprintf("CamelCatalog version: %s",
platform.Status.Build.RuntimeVersion)
- if platform.Status.Build.RuntimeProvider != "" {
- msg += fmt.Sprintf(", provider: %s",
platform.Status.Build.RuntimeProvider)
- }
- msg += fmt.Sprintf(" can't be found in %s namespace",
platform.Namespace)
- return nil, errors.New(msg)
+ if catalog != nil {
+ infos["Camel Quarkus version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["camel-quarkus.version"]
+ infos["Camel version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["camel.version"]
+ infos["Quarkus version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["quarkus.version"]
}
- infos["Camel Quarkus version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["camel-quarkus.version"]
- infos["Camel version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["camel.version"]
- infos["Quarkus version"] =
catalog.CamelCatalogSpec.Runtime.Metadata["quarkus.version"]
-
return infos, nil
}
diff --git a/pkg/controller/catalog/initialize.go
b/pkg/controller/catalog/initialize.go
index 83553cbe3..a80712e65 100644
--- a/pkg/controller/catalog/initialize.go
+++ b/pkg/controller/catalog/initialize.go
@@ -152,6 +152,7 @@ func initializeSpectrum(options spectrum.Options, ip
*v1.IntegrationPlatform, ca
err := buildRuntimeBuilderWithTimeoutSpectrum(options,
ip.Status.Build.GetBuildCatalogToolTimeout().Duration)
if err != nil {
+ Log.Error(err, "Error trying to build Camel K builder
container")
target.Status.Phase = v1.CamelCatalogPhaseError
target.Status.SetErrorCondition(
v1.CamelCatalogConditionReady,