astefanutti commented on a change in pull request #1478: URL: https://github.com/apache/camel-k/pull/1478#discussion_r433699647
########## File path: pkg/trait/prometheus.go ########## @@ -121,10 +121,13 @@ func (t *prometheusTrait) Apply(e *Environment) (err error) { options := []string{strconv.Itoa(t.Port), path.Join(prometheusJmxExporterConfigMountPath, prometheusJmxExporterConfigFileName)} container.Args = append(container.Args, "-javaagent:dependencies/io.prometheus.jmx.jmx_prometheus_javaagent-0.3.1.jar="+strings.Join(options, ":")) - // Add the container port - containerPort := t.getContainerPort() - container.Ports = append(container.Ports, *containerPort) - condition.Message = fmt.Sprintf("%s(%s/%d)", container.Name, containerPort.Name, containerPort.ContainerPort) + // Skip declaring the Prometheus port when Knative is enabled, + // as only one container port is supported. + if e.DetermineProfile() != v1.TraitProfileKnative { Review comment: Ah you're right, let me rework it! ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org