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

nferraro 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 b599fc0  chore: rename constant KamelPlatform to 
IntegrationContextTypePlatform
b599fc0 is described below

commit b599fc03bef7edb8cdb60f046ad52b1beb510c77
Author: lburgazzoli <lburgazz...@gmail.com>
AuthorDate: Thu Dec 6 19:02:50 2018 +0100

    chore: rename constant KamelPlatform to IntegrationContextTypePlatform
---
 pkg/apis/camel/v1alpha1/types.go             | 5 +++--
 pkg/builder/builder_steps.go                 | 2 +-
 pkg/client/cmd/context_create.go             | 2 +-
 pkg/client/cmd/context_delete.go             | 4 ++--
 pkg/client/cmd/context_get.go                | 4 ++--
 pkg/stub/action/integration/build_context.go | 4 ++--
 pkg/stub/action/integration/util.go          | 2 +-
 7 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/pkg/apis/camel/v1alpha1/types.go b/pkg/apis/camel/v1alpha1/types.go
index ab396e5..237dc95 100644
--- a/pkg/apis/camel/v1alpha1/types.go
+++ b/pkg/apis/camel/v1alpha1/types.go
@@ -93,8 +93,6 @@ const (
        LanguageXML Language = "xml"
        // LanguageKotlin --
        LanguageKotlin Language = "kts"
-       // KamelPlatform --
-       KamelPlatform = "platform"
 )
 
 // A IntegrationTraitSpec contains the configuration of a trait
@@ -191,6 +189,9 @@ const (
        // IntegrationContextKind --
        IntegrationContextKind string = "IntegrationContext"
 
+       // IntegrationContextTypePlatform --
+       IntegrationContextTypePlatform = "platform"
+
        // IntegrationContextPhaseBuilding --
        IntegrationContextPhaseBuilding IntegrationContextPhase = "Building"
        // IntegrationContextPhaseReady --
diff --git a/pkg/builder/builder_steps.go b/pkg/builder/builder_steps.go
index 4a24e02..a32502e 100644
--- a/pkg/builder/builder_steps.go
+++ b/pkg/builder/builder_steps.go
@@ -285,7 +285,7 @@ func ListPublishedImages(namespace string) 
([]PublishedImage, error) {
                if ctx.Status.Phase != v1alpha1.IntegrationContextPhaseReady || 
ctx.Labels == nil {
                        continue
                }
-               if ctxType, present := 
ctx.Labels["camel.apache.org/context.type"]; !present || ctxType != 
v1alpha1.KamelPlatform {
+               if ctxType, present := 
ctx.Labels["camel.apache.org/context.type"]; !present || ctxType != 
v1alpha1.IntegrationContextTypePlatform {
                        continue
                }
 
diff --git a/pkg/client/cmd/context_create.go b/pkg/client/cmd/context_create.go
index 497f4d6..0bc8e97 100644
--- a/pkg/client/cmd/context_create.go
+++ b/pkg/client/cmd/context_create.go
@@ -86,7 +86,7 @@ func (command *contextCreateCommand) run(cmd *cobra.Command, 
args []string) erro
                // the integration context already exists, let's check that it 
is
                // not a platform one which is supposed to be "read only"
 
-               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.KamelPlatform {
+               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.IntegrationContextTypePlatform {
                        fmt.Printf("integration context \"%s\" is not 
editable\n", ctx.Name)
                        return nil
                }
diff --git a/pkg/client/cmd/context_delete.go b/pkg/client/cmd/context_delete.go
index d22b61e..cf64eee 100644
--- a/pkg/client/cmd/context_delete.go
+++ b/pkg/client/cmd/context_delete.go
@@ -82,7 +82,7 @@ func (command *contextDeleteCommand) run(args []string) error 
{
                names = make([]string, 0, len(ctxList.Items))
                for _, item := range ctxList.Items {
                        // only include non platform contexts
-                       if item.Labels["camel.apache.org/context.type"] != 
v1alpha1.KamelPlatform {
+                       if item.Labels["camel.apache.org/context.type"] != 
v1alpha1.IntegrationContextTypePlatform {
                                names = append(names, item.Name)
                        }
                }
@@ -114,7 +114,7 @@ func (command *contextDeleteCommand) delete(name string) 
error {
 
        // check that it is not a platform one which is supposed to be "read 
only"
        // thus not managed by the end user
-       if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.KamelPlatform {
+       if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.IntegrationContextTypePlatform {
                // skip platform contexts while deleting all contexts
                if command.all {
                        return nil
diff --git a/pkg/client/cmd/context_get.go b/pkg/client/cmd/context_get.go
index af60a93..f264b91 100644
--- a/pkg/client/cmd/context_get.go
+++ b/pkg/client/cmd/context_get.go
@@ -49,7 +49,7 @@ func newContextGetCmd(rootCmdOptions *RootCmdOptions) 
*cobra.Command {
        }
 
        cmd.Flags().BoolVar(&impl.user, "user", true, "Includes user contexts")
-       cmd.Flags().BoolVar(&impl.platform, v1alpha1.KamelPlatform, true, 
"Includes platform contexts")
+       cmd.Flags().BoolVar(&impl.platform, 
v1alpha1.IntegrationContextTypePlatform, true, "Includes platform contexts")
 
        return &cmd
 }
@@ -76,7 +76,7 @@ func (command *contextGetCommand) run() error {
        for _, ctx := range ctxList.Items {
                t := ctx.Labels["camel.apache.org/context.type"]
                u := command.user && t == "user"
-               p := command.platform && t == v1alpha1.KamelPlatform
+               p := command.platform && t == 
v1alpha1.IntegrationContextTypePlatform
 
                if u || p {
                        fmt.Fprintf(w, "%s\t%s\t%s\n", ctx.Name, t, 
string(ctx.Status.Phase))
diff --git a/pkg/stub/action/integration/build_context.go 
b/pkg/stub/action/integration/build_context.go
index 679945e..ecadcc5 100644
--- a/pkg/stub/action/integration/build_context.go
+++ b/pkg/stub/action/integration/build_context.go
@@ -60,7 +60,7 @@ func (action *buildContextAction) Handle(integration 
*v1alpha1.Integration) erro
        }
 
        if ctx != nil {
-               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.KamelPlatform {
+               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.IntegrationContextTypePlatform {
                        // This is a platform context and as it is auto 
generated it may get
                        // out of sync if the integration that has generated 
it, has been
                        // amended to add/remove dependencies
@@ -129,7 +129,7 @@ func (action *buildContextAction) Handle(integration 
*v1alpha1.Integration) erro
        // Add some information for post-processing, this may need to be 
refactored
        // to a proper data structure
        platformCtx.Labels = map[string]string{
-               "camel.apache.org/context.type":               
v1alpha1.KamelPlatform,
+               "camel.apache.org/context.type":               
v1alpha1.IntegrationContextTypePlatform,
                "camel.apache.org/context.created.by.kind":    
v1alpha1.IntegrationKind,
                "camel.apache.org/context.created.by.name":    integration.Name,
                "camel.apache.org/context.created.by.version": 
integration.ResourceVersion,
diff --git a/pkg/stub/action/integration/util.go 
b/pkg/stub/action/integration/util.go
index b48e6f1..26c1fd8 100644
--- a/pkg/stub/action/integration/util.go
+++ b/pkg/stub/action/integration/util.go
@@ -45,7 +45,7 @@ func LookupContextForIntegration(integration 
*v1alpha1.Integration) (*v1alpha1.I
 
        for _, ctx := range ctxList.Items {
                ctx := ctx // pin
-               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.KamelPlatform {
+               if ctx.Labels["camel.apache.org/context.type"] == 
v1alpha1.IntegrationContextTypePlatform {
                        ideps := len(integration.Spec.Dependencies)
                        cdeps := len(ctx.Spec.Dependencies)
 

Reply via email to