You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/10/09 10:33:00 UTC
[camel-k] 02/02: refactor: use existing getting for catalog versions
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
commit 9d1143f803f0aded076aa05d94f16fe6d7c14d2e
Author: Gaelle Fournier <ga...@gmail.com>
AuthorDate: Thu Oct 5 19:22:13 2023 +0200
refactor: use existing getting for catalog versions
---
pkg/cmd/version.go | 6 +++---
pkg/cmd/version_test.go | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go
index 4cc93085c..1f635209d 100644
--- a/pkg/cmd/version.go
+++ b/pkg/cmd/version.go
@@ -153,9 +153,9 @@ func operatorInfo(ctx context.Context, c client.Client, namespace string) (map[s
return nil, err
}
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.GetCamelQuarkusVersion()
+ infos["Camel version"] = catalog.CamelCatalogSpec.GetCamelVersion()
+ infos["Quarkus version"] = catalog.CamelCatalogSpec.GetQuarkusVersion()
}
return infos, nil
diff --git a/pkg/cmd/version_test.go b/pkg/cmd/version_test.go
index 053e0dae8..e911e12d3 100644
--- a/pkg/cmd/version_test.go
+++ b/pkg/cmd/version_test.go
@@ -101,9 +101,9 @@ func TestOperatorVersionVerbose(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, true, versionCmdOptions.Verbose)
assert.Contains(t, output, fmt.Sprintf("Camel K Operator %s\n", defaults.Version))
- assert.Contains(t, output, fmt.Sprintf("Camel version: %s\n", catalog.Spec.Runtime.Metadata["camel.version"]))
- assert.Contains(t, output, fmt.Sprintf("Camel Quarkus version: %s\n", catalog.Spec.Runtime.Metadata["camel-quarkus.version"]))
- assert.Contains(t, output, fmt.Sprintf("Quarkus version: %s\n", catalog.Spec.Runtime.Metadata["quarkus.version"]))
+ assert.Contains(t, output, fmt.Sprintf("Camel version: %s\n", catalog.Spec.GetCamelVersion()))
+ assert.Contains(t, output, fmt.Sprintf("Camel Quarkus version: %s\n", catalog.Spec.GetCamelQuarkusVersion()))
+ assert.Contains(t, output, fmt.Sprintf("Quarkus version: %s\n", catalog.Spec.GetQuarkusVersion()))
}
func TestCompatibleVersions(t *testing.T) {