From 4b357174433263bd64fb5afe7f221b412d392404 Mon Sep 17 00:00:00 2001 From: lburgazzoli Date: Wed, 9 Jan 2019 01:09:16 +0100 Subject: [PATCH] chore(ux): show the same basic info with oc and kamel --- deploy/crd-integration-context.yaml | 8 ++++++++ deploy/crd-integration.yaml | 4 ++++ deploy/resources.go | 12 ++++++++++++ pkg/cmd/context_get.go | 4 ++-- pkg/cmd/get.go | 4 ++-- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/deploy/crd-integration-context.yaml b/deploy/crd-integration-context.yaml index f33ad81172..7d82cd4605 100644 --- a/deploy/crd-integration-context.yaml +++ b/deploy/crd-integration-context.yaml @@ -20,3 +20,11 @@ spec: type: string description: The IntegrationContext phase JSONPath: .status.phase + - name: Type + type: string + description: The IntegrationContext type + JSONPath: .metadata.labels.camel\.apache\.org\/context\.type + - name: Image + type: string + description: The IntegrationContext image + JSONPath: .status.image diff --git a/deploy/crd-integration.yaml b/deploy/crd-integration.yaml index af20b4c508..11db52bf9c 100644 --- a/deploy/crd-integration.yaml +++ b/deploy/crd-integration.yaml @@ -20,3 +20,7 @@ spec: type: string description: The Integration phase JSONPath: .status.phase + - name: Context + type: string + description: The IntegrationContext to use + JSONPath: .status.context diff --git a/deploy/resources.go b/deploy/resources.go index f256198265..c9da6cbbb4 100644 --- a/deploy/resources.go +++ b/deploy/resources.go @@ -2216,6 +2216,14 @@ spec: type: string description: The IntegrationContext phase JSONPath: .status.phase + - name: Type + type: string + description: The IntegrationContext type + JSONPath: .metadata.labels.camel\.apache\.org\/context\.type + - name: Image + type: string + description: The IntegrationContext image + JSONPath: .status.image ` Resources["crd-integration-platform.yaml"] = @@ -2268,6 +2276,10 @@ spec: type: string description: The Integration phase JSONPath: .status.phase + - name: Context + type: string + description: The IntegrationContext to use + JSONPath: .status.context ` Resources["cr-example.yaml"] = diff --git a/pkg/cmd/context_get.go b/pkg/cmd/context_get.go index eab23908e0..3fdab17479 100644 --- a/pkg/cmd/context_get.go +++ b/pkg/cmd/context_get.go @@ -77,14 +77,14 @@ func (command *contextGetCommand) run() error { } w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) - fmt.Fprintln(w, "NAME\tTYPE\tSTATUS") + fmt.Fprintln(w, "NAME\tPHASE\tTYPE\tIMAGE") for _, ctx := range ctxList.Items { t := ctx.Labels["camel.apache.org/context.type"] u := command.user && t == "user" 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)) + fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", ctx.Name, string(ctx.Status.Phase), t, ctx.Status.Image) } } w.Flush() diff --git a/pkg/cmd/get.go b/pkg/cmd/get.go index 619333c15d..1f7ab70f6d 100644 --- a/pkg/cmd/get.go +++ b/pkg/cmd/get.go @@ -68,9 +68,9 @@ func (o *getCmdOptions) run(cmd *cobra.Command, args []string) error { } w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) - fmt.Fprintln(w, "NAME\tCONTEXT\tSTATUS") + fmt.Fprintln(w, "NAME\tPHASE\tCONTEXT") for _, integration := range integrationList.Items { - fmt.Fprintf(w, "%s\t%s\t%s\n", integration.Name, integration.Status.Context, string(integration.Status.Phase)) + fmt.Fprintf(w, "%s\t%s\t%s\n", integration.Name, string(integration.Status.Phase), integration.Status.Context) } w.Flush()