squakez commented on code in PR #4235:
URL: https://github.com/apache/camel-k/pull/4235#discussion_r1162901625
##########
pkg/cmd/version.go:
##########
@@ -159,15 +161,30 @@ func operatorInfo(ctx context.Context, c client.Client,
namespace string) (map[s
}
}
+ catalog, err := camel.LoadCatalog(ctx, c, namespace,
v1.RuntimeSpec{Version: platform.Status.Build.RuntimeVersion, Provider:
platform.Status.Build.RuntimeProvider})
+ if err != nil {
+ return nil, err
+ } else {
+ if catalog == nil {
+ return nil, fmt.Errorf("CamelCatalog can't be found in
%s namespace", platform.Namespace)
+ }
+ for k, v := range catalog.CamelCatalogSpec.Runtime.Metadata {
+ infos[k] = v
+ }
+ }
+
ccInfo := fromCamelCase(infos)
log.Debugf("Operator Info for namespace %s: %v", namespace, ccInfo)
return ccInfo, nil
}
func fromCamelCase(infos map[string]string) map[string]string {
textKeys := make(map[string]string)
+ replaceRegexp := regexp.MustCompile(`(\s+\.\s*)|(\s+-\s*)`)
Review Comment:
This can be scoped outside the func, just noticed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]