This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch pr-442
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit de73a57d00d2a332e663d673127bbb2d012d7985
Author: Antonin Stefanutti <anto...@stefanutti.fr>
AuthorDate: Tue Feb 28 15:07:07 2023 +0100

    feat: Add path option to ingress trait
---
 pkg/apis/camel/v1/trait/ingress.go | 2 ++
 pkg/trait/ingress.go               | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/pkg/apis/camel/v1/trait/ingress.go 
b/pkg/apis/camel/v1/trait/ingress.go
index 1a76319d4..3d93f4aa1 100644
--- a/pkg/apis/camel/v1/trait/ingress.go
+++ b/pkg/apis/camel/v1/trait/ingress.go
@@ -27,6 +27,8 @@ type IngressTrait struct {
        Trait `property:",squash" json:",inline"`
        // To configure the host exposed by the ingress.
        Host string `property:"host" json:"host,omitempty"`
+       // To configure the path exposed by the ingress (default `/`).
+       Path string `property:"path" json:"path,omitempty"`
        // To automatically add an ingress whenever the integration uses an 
HTTP endpoint consumer.
        Auto *bool `property:"auto" json:"auto,omitempty"`
 }
diff --git a/pkg/trait/ingress.go b/pkg/trait/ingress.go
index 99da27bba..ea9eb0a44 100644
--- a/pkg/trait/ingress.go
+++ b/pkg/trait/ingress.go
@@ -40,6 +40,7 @@ func newIngressTrait() Trait {
                BaseTrait: NewBaseTrait("ingress", 2400),
                IngressTrait: traitv1.IngressTrait{
                        Host: "",
+                       Path: "/",
                },
        }
 }
@@ -104,7 +105,7 @@ func (t *ingressTrait) Apply(e *Environment) error {
                                                HTTP: 
&networkingv1.HTTPIngressRuleValue{
                                                        Paths: 
[]networkingv1.HTTPIngressPath{
                                                                {
-                                                                       Path:   
  "/",
+                                                                       Path:   
  t.Path,
                                                                        
PathType: &pathType,
                                                                        
Backend: networkingv1.IngressBackend{
                                                                                
Service: &networkingv1.IngressServiceBackend{

Reply via email to