Skip to content

Commit

Permalink
Don't automatically install contexts upon platform installation apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli authored and ipolyzos committed Jul 31, 2019
1 parent 118507d commit 0988ace
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
11 changes: 0 additions & 11 deletions pkg/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 {
Expand Down
20 changes: 0 additions & 20 deletions pkg/controller/integrationplatform/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions pkg/platform/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit 0988ace

Please sign in to comment.