You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2018/12/06 16:06:52 UTC

[camel-k] 05/06: Fix after rebase

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 2da7dd0ad2b0a00d7de9721c93ca5440a322ad90
Author: nferraro <ni...@gmail.com>
AuthorDate: Thu Dec 6 12:32:16 2018 +0100

    Fix after rebase
---
 pkg/trait/knative.go |  1 -
 pkg/trait/service.go | 16 +++-------------
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/pkg/trait/knative.go b/pkg/trait/knative.go
index 1687581..716392a 100644
--- a/pkg/trait/knative.go
+++ b/pkg/trait/knative.go
@@ -20,7 +20,6 @@ package trait
 import (
 	"encoding/json"
 	"fmt"
-	"strings"
 
 	"github.com/operator-framework/operator-sdk/pkg/sdk"
 	"github.com/pkg/errors"
diff --git a/pkg/trait/service.go b/pkg/trait/service.go
index df0d66f..0efaf45 100644
--- a/pkg/trait/service.go
+++ b/pkg/trait/service.go
@@ -20,7 +20,6 @@ package trait
 import (
 	"github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
 	"github.com/apache/camel-k/pkg/metadata"
-	"k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/util/intstr"
@@ -45,18 +44,9 @@ func (s *serviceTrait) appliesTo(e *Environment) bool {
 
 func (s *serviceTrait) autoconfigure(e *Environment) error {
 	if s.Enabled == nil {
-		hasDeployment := false
-		e.Resources.VisitDeployment(func(s *v1.Deployment) {
-			hasDeployment = true
-		})
-		if hasDeployment {
-			meta := metadata.ExtractAll(e.Integration.Spec.Sources)
-			required := meta.RequiresHTTPService
-			s.Enabled = &required
-		} else {
-			enabled := false
-			s.Enabled = &enabled
-		}
+		meta := metadata.ExtractAll(e.Integration.Spec.Sources)
+		required := meta.RequiresHTTPService
+		s.Enabled = &required
 	}
 	return nil
 }