From commits-return-66396-archive-asf-public=cust-asf.ponee.io@camel.apache.org Mon Nov 5 20:46:32 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4980918077B for ; Mon, 5 Nov 2018 20:46:32 +0100 (CET) Received: (qmail 11502 invoked by uid 500); 5 Nov 2018 19:46:31 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 11493 invoked by uid 99); 5 Nov 2018 19:46:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2018 19:46:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 3D2B282C3B; Mon, 5 Nov 2018 19:46:30 +0000 (UTC) Date: Mon, 05 Nov 2018 19:46:34 +0000 To: "commits@camel.apache.org" Subject: [camel-k] 05/06: Add host property to the route trait MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: lburgazzoli@apache.org In-Reply-To: <154144718982.30093.3547791064519463861@gitbox.apache.org> References: <154144718982.30093.3547791064519463861@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: camel-k X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: c028e802db4ccddefede46afa25b21aed91f63cb X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20181105194630.3D2B282C3B@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-k.git commit c028e802db4ccddefede46afa25b21aed91f63cb Author: nferraro AuthorDate: Mon Nov 5 15:39:19 2018 +0100 Add host property to the route trait --- deploy/operator-role-openshift.yaml | 8 ++++++++ deploy/resources.go | 8 ++++++++ docs/traits.adoc | 8 ++++++++ pkg/trait/route.go | 4 +++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/deploy/operator-role-openshift.yaml b/deploy/operator-role-openshift.yaml index 788a7cc..41a5f72 100644 --- a/deploy/operator-role-openshift.yaml +++ b/deploy/operator-role-openshift.yaml @@ -119,3 +119,11 @@ rules: - patch - update - watch +- apiGroups: + - "" + - route.openshift.io + resources: + - routes/custom-host + verbs: + - create + diff --git a/deploy/resources.go b/deploy/resources.go index 4fcbce0..b3e753e 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -2511,6 +2511,14 @@ rules: - patch - update - watch +- apiGroups: + - "" + - route.openshift.io + resources: + - routes/custom-host + verbs: + - create + ` Resources["operator-service-account.yaml"] = diff --git a/docs/traits.adoc b/docs/traits.adoc index c25e533..ff2ec93 100644 --- a/docs/traits.adoc +++ b/docs/traits.adoc @@ -77,6 +77,14 @@ The following is a list of common traits that can be configured by the end users + It's enabled by default whenever a Service is added to the integration (through the `service` trait). +[cols="m,"] +!=== + +! route.host +! To configure the host exposed by the route. + +!=== + | ingress | Kubernetes | Exposes the service associated with the integration to the outside world with a Kubernetes Ingress. diff --git a/pkg/trait/route.go b/pkg/trait/route.go index b3efa1a..02299b1 100644 --- a/pkg/trait/route.go +++ b/pkg/trait/route.go @@ -28,6 +28,7 @@ import ( type routeTrait struct { BaseTrait `property:",squash"` + Host string `property:"host"` } func newRouteTrait() *routeTrait { @@ -65,7 +66,7 @@ func (*routeTrait) getTargetService(e *environment, resources *kubernetes.Collec return } -func (*routeTrait) getRouteFor(e *environment, service *corev1.Service) *routev1.Route { +func (e *routeTrait) getRouteFor(env *environment, service *corev1.Service) *routev1.Route { route := routev1.Route{ TypeMeta: metav1.TypeMeta{ Kind: "Route", @@ -83,6 +84,7 @@ func (*routeTrait) getRouteFor(e *environment, service *corev1.Service) *routev1 Kind: "Service", Name: service.Name, }, + Host: e.Host, }, } return &route