Skip to content

Commit

Permalink
refactor: use existing getting for catalog versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer authored and squakez committed Oct 9, 2023
1 parent e3e947f commit 9d1143f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9d1143f

Please sign in to comment.