You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "lburgazzoli (via GitHub)" <gi...@apache.org> on 2024/02/27 09:16:28 UTC

Re: [PR] feat(trait): enable health trait by default [camel-k]

lburgazzoli commented on code in PR #5096:
URL: https://github.com/apache/camel-k/pull/5096#discussion_r1503894313


##########
pkg/trait/health.go:
##########
@@ -57,7 +57,13 @@ func (t *healthTrait) Configure(e *Environment) (bool, *TraitCondition, error) {
 		!e.IntegrationInPhase(v1.IntegrationPhaseInitialization) && !e.IntegrationInRunningPhases() {
 		return false, nil, nil
 	}
-	if !pointer.BoolDeref(t.Enabled, false) {
+	// The trait must be disabled if it's a user based build (for which we do not control the way to handle Health checks)
+	if ct := e.Catalog.GetTrait(containerTraitID); ct != nil {
+		if ct, ok := ct.(*containerTrait); ok && ct.hasUserProvidedImage() {
+			return false, newIntegrationConditionPlatformDisabledWithMessage("container image was not built via Camel K operator"), nil

Review Comment:
   so what happen for a user provided image ? can't we enable health checks if the user explicitly enable them ?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org