lburgazzoli commented on issue #375: Jolokia trait initial implementation URL: https://github.com/apache/camel-k/pull/375#issuecomment-457281763 Another option would be to add a boolean like agent-enabled with false as default value. then disable the trait only when it is explicit disabled (like other trait do) On Thu, 24 Jan 2019 at 18:17, Antonin Stefanutti <notificati...@github.com> wrote: > *@astefanutti* commented on this pull request. > ------------------------------ > > In pkg/trait/jolokia.go > <https://github.com/apache/camel-k/pull/375#discussion_r250700257>: > > > + }, > + Port: 8778, > + } > +} > + > +func (t *jolokiaTrait) Configure(e *Environment) (bool, error) { > + enabled := false > + > + if e.IntegrationInPhase(v1alpha1.IntegrationPhaseDeploying) && t.Enabled != nil && *t.Enabled { > + enabled = true > + } > + > + // Deactivate the Jolokia Java agent accordingly > + // Note: the AB_JOLOKIA_OFF environment variable acts as an option flag > + if !enabled { > + envvar.SetVal(&e.EnvVars, "AB_JOLOKIA_OFF", "true") > > My understanding is that the Apply method is not called when the trait is > disabled. In some use cases, a disabled trait needs to *alter* the > environment. > > — > You are receiving this because you commented. > > > Reply to this email directly, view it on GitHub > <https://github.com/apache/camel-k/pull/375#discussion_r250700257>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/AByEhUr1I0VEUpIcZWx5Bt0oGsGyodorks5vGeqOgaJpZM4aRJqk> > . > -- -- Luca Burgazzoli
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services