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

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


The following commit(s) were added to refs/heads/master by this push:
     new 356eb5e  Don't automatically install contexts upon platform 
installation #716
356eb5e is described below

commit 356eb5ed12ee7b43481e4da79d1fa465b665a3ab
Author: lburgazzoli <lburgazz...@gmail.com>
AuthorDate: Fri May 31 16:09:20 2019 +0200

    Don't automatically install contexts upon platform installation #716
---
 pkg/cmd/install.go                           | 11 -----------
 pkg/controller/integrationplatform/create.go | 20 --------------------
 pkg/platform/resources.go                    |  3 ---
 3 files changed, 34 deletions(-)

diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go
index a2ca340..e0f502e 100644
--- a/pkg/cmd/install.go
+++ b/pkg/cmd/install.go
@@ -24,7 +24,6 @@ import (
 
        "github.com/apache/camel-k/deploy"
        "github.com/apache/camel-k/pkg/apis"
-       "github.com/apache/camel-k/pkg/platform"
        "go.uber.org/multierr"
        "k8s.io/apimachinery/pkg/runtime"
 
@@ -306,16 +305,6 @@ func (o *installCmdOptions) validate(_ *cobra.Command, _ 
[]string) error {
 }
 
 func errorIfContextIsNotAvailable(schema *runtime.Scheme, context string, 
nrContexts int) error {
-
-       if context == platform.NoContext {
-               if nrContexts > 1 {
-                       return errors.New("You can only use one --context 
argument when selecting 'none'")
-               }
-
-               // Indicates that nothing should be installed
-               return nil
-       }
-
        for _, resource := range deploy.Resources {
                resource, err := kubernetes.LoadResourceFromYaml(schema, 
resource)
                if err != nil {
diff --git a/pkg/controller/integrationplatform/create.go 
b/pkg/controller/integrationplatform/create.go
index 023852e..0d1fc45 100644
--- a/pkg/controller/integrationplatform/create.go
+++ b/pkg/controller/integrationplatform/create.go
@@ -26,7 +26,6 @@ import (
 
        "github.com/apache/camel-k/pkg/apis/camel/v1alpha1"
        "github.com/apache/camel-k/pkg/install"
-       p "github.com/apache/camel-k/pkg/platform"
 )
 
 // NewCreateAction returns a action that creates resources needed by the 
platform
@@ -61,11 +60,6 @@ func (action *createAction) Handle(ctx context.Context, 
platform *v1alpha1.Integ
                res := make([]string, 0, l)
 
                for _, c := range platform.Spec.Resources.Contexts {
-                       if c == p.NoContext {
-                               // Signals nothing to install
-                               continue
-                       }
-
                        //
                        // Assuming that if the resource ends with a yaml 
extension, the full
                        // resource name is provided
@@ -84,20 +78,6 @@ func (action *createAction) Handle(ctx context.Context, 
platform *v1alpha1.Integ
                                return err
                        }
                }
-       } else {
-               action.L.Info("Installing default platform resources")
-               err := install.Resources(ctx, action.client, 
platform.Namespace, install.IdentityResourceCustomizer, p.DefaultContexts...)
-               if err != nil {
-                       return err
-               }
-
-               if platform.Spec.Profile == v1alpha1.TraitProfileKnative {
-                       action.L.Info("Installing knative resources")
-                       err := install.Resources(ctx, action.client, 
platform.Namespace, install.IdentityResourceCustomizer, p.KnativeContexts...)
-                       if err != nil {
-                               return err
-                       }
-               }
        }
 
        target := platform.DeepCopy()
diff --git a/pkg/platform/resources.go b/pkg/platform/resources.go
index 83523c1..2183651 100644
--- a/pkg/platform/resources.go
+++ b/pkg/platform/resources.go
@@ -31,9 +31,6 @@ var KnativeContexts = []string{
        "platform-integration-context-knative.yaml",
 }
 
-// NoContext is a placeholder for a not-present context
-const NoContext = "none"
-
 // GetContexts --
 func GetContexts() []string {
        return append(DefaultContexts, KnativeContexts...)

Reply via email to