squakez commented on code in PR #6841:
URL: https://github.com/apache/camel-k/pull/6841#discussion_r4071429131
##########
pkg/trait/camel.go:
##########
@@ -71,7 +72,8 @@ func (t *camelTrait) Matches(trait Trait) bool {
return false
}
- return otherTrait.RuntimeVersion == t.RuntimeVersion
+ return otherTrait.RuntimeVersion == t.RuntimeVersion &&
+ ptr.Deref(otherTrait.SkipObservabilityServices, false) ==
ptr.Deref(t.SkipObservabilityServices, false)
Review Comment:
I don't think this is really needed. The match would fail anyway when
verifying all dependencies if that makes sense.
##########
pkg/apis/camel/v1/trait/camel.go:
##########
@@ -34,4 +34,7 @@ type CamelTrait struct {
RuntimeVersion string `json:"runtimeVersion,omitempty"
property:"runtime-version"`
// A list of properties to be provided to the Integration runtime
Properties []string `json:"properties,omitempty" property:"properties"`
+
+ // Whether to skip the default camel-quarkus-observability-services
dependency
Review Comment:
Better to call it generically "Camel Observability Services". For now it is
associated to quarkus runtime, but it could be different in the future.
##########
pkg/trait/health.go:
##########
@@ -94,6 +94,12 @@ func (t *healthTrait) Configure(e *Environment) (bool,
*TraitCondition, error) {
"build from Git: container probes disabled, you can
turn explicitly on"), nil
}
+ // Skip if observability services are skipped, unless explicitly
enabled or configured
+ if isSkipObservabilityServices(e) && !t.isExplicitlyConfigured() {
Review Comment:
No, this part must be removed. The health should be executed anyhow unless
disabled by the user. The point of removing the obsSvc component is to let the
user instead configuring each health and metrics component independently.
##########
pkg/trait/dependencies.go:
##########
@@ -50,6 +51,16 @@ func (t *dependenciesTrait) Configure(e *Environment) (bool,
*TraitCondition, er
return e.IntegrationInPhase(v1.IntegrationPhaseInitialization), nil, nil
}
+func isSkipObservabilityServices(e *Environment) bool {
Review Comment:
Let's make this part of the this trait only `func (t *dependenciesTrait)...`
to lock and avoid any external trait to be tempted to reuse.
--
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]