squakez commented on code in PR #5650: URL: https://github.com/apache/camel-k/pull/5650#discussion_r1642894770
########## pkg/trait/ingress.go: ########## @@ -126,6 +128,15 @@ func (t *ingressTrait) Apply(e *Environment) error { }, } + if len(t.TLSHosts) > 0 || len(strings.TrimSpace(t.TLSSecretName)) > 0 { + ingress.Spec.TLS = []networkingv1.IngressTLS{ + { + Hosts: t.TLSHosts, + SecretName: t.TLSSecretName, + }, + } + } Review Comment: BTW, you can add some unit test to validate the different conditions (positive and negative). ########## pkg/trait/ingress.go: ########## @@ -126,6 +128,15 @@ func (t *ingressTrait) Apply(e *Environment) error { }, } + if len(t.TLSHosts) > 0 || len(strings.TrimSpace(t.TLSSecretName)) > 0 { + ingress.Spec.TLS = []networkingv1.IngressTLS{ + { + Hosts: t.TLSHosts, + SecretName: t.TLSSecretName, + }, + } + } Review Comment: We can just maybe check it `t.TLSSecretName != ""`, the rest of the check seems fine. If IIUC the condition you are checking here is to have either t.TLSHosts or t.TLSSecretName. If you need both, then we probably need something like `len(t.TLSHosts) > 0 && t.TLSSecretName != ""` -- 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-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org