Skip to content

Commit

Permalink
fix(trait): telemetry workaround
Browse files Browse the repository at this point in the history
Closes #6002
  • Loading branch information
squakez committed Jan 29, 2025
1 parent f390f35 commit 0da7fa1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkg/trait/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package trait
import (
"fmt"

"github.com/Masterminds/semver"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
"github.com/apache/camel-k/v2/pkg/trait/discovery"
Expand Down Expand Up @@ -130,11 +131,20 @@ func (t *telemetryTrait) Configure(e *Environment) (bool, *TraitCondition, error
func (t *telemetryTrait) Apply(e *Environment) error {
util.StringSliceUniqueAdd(&e.Integration.Status.Capabilities, v1.CapabilityTelemetry)

// Hack for camel-k-runtime 3.15.0
if e.CamelCatalog.CamelCatalogSpec.Runtime.Provider.IsQuarkusBased() &&
e.CamelCatalog.CamelCatalogSpec.Runtime.Version == "3.15.0" {
t.setRuntimeProviderQuarkus315Properties(e)
return nil
if e.CamelCatalog.CamelCatalogSpec.Runtime.Provider.IsQuarkusBased() {
// Hack for camel-k-runtime >= 3.15.0
ck315, err := semver.NewVersion("3.15.0")
if err != nil {
return err
}
qv, err := semver.NewVersion(e.CamelCatalog.CamelCatalogSpec.Runtime.Version)
if err != nil {
return err
}
if qv.Compare(ck315) >= 0 {
t.setRuntimeProviderQuarkus315Properties(e)
return nil
}
}
if e.CamelCatalog.Runtime.Capabilities["telemetry"].RuntimeProperties != nil {
t.setCatalogConfiguration(e)
Expand Down

0 comments on commit 0da7fa1

Please sign in to comment.