astefanutti commented on a change in pull request #825: Misleading
"service.enabled=false" when used in combination with the prometheus trait i
URL: https://github.com/apache/camel-k/pull/825#discussion_r304463719
##########
File path: pkg/trait/prometheus.go
##########
@@ -116,6 +82,67 @@ func (t *prometheusTrait) Apply(e *Environment) (err
error) {
return nil
}
+func (t *prometheusTrait) configurePorts(e *Environment) bool {
+ service, servicePort := t.configureServicePort(e)
+ container, containerPort := t.configureContainerPort(e)
+
+ condition := v1alpha1.IntegrationCondition{
+ Type: v1alpha1.IntegrationConditionPrometheusAvailable,
+ }
+
+ if containerPort == nil {
+ condition.Status = corev1.ConditionFalse
+ condition.Reason =
v1alpha1.IntegrationConditionContainerNotAvailableReason
+ } else {
+ container.Ports = append(container.Ports, *containerPort)
+
+ condition.Status = corev1.ConditionTrue
+ condition.Reason =
v1alpha1.IntegrationConditionPrometheusAvailableReason
+ condition.Message = fmt.Sprintf("%s(%s/%d)", container.Name,
containerPort.Name, containerPort.ContainerPort)
+ }
+
+ if servicePort != nil {
Review comment:
Shouldn't the condition be updated with the reason the service is not
available when `service` is `nil`?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services