You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/05/05 07:18:11 UTC
[camel-k] branch main updated: feat(cli): provide useful info in kubectl CLI
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new 71ceccf17 feat(cli): provide useful info in kubectl CLI
71ceccf17 is described below
commit 71ceccf1792a2d439237cf2989b0fab6d370e3dc
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu May 4 16:02:40 2023 +0200
feat(cli): provide useful info in kubectl CLI
Closes #4205
Closes #4172
---
.../duck/client/internalclientset/fake/register.go | 14 +++++++-------
.../duck/client/internalclientset/scheme/register.go | 14 +++++++-------
config/crd/bases/camel.apache.org_camelcatalogs.yaml | 12 ++++++++----
config/crd/bases/camel.apache.org_integrationkits.yaml | 8 ++++++++
.../crd/bases/camel.apache.org_integrationplatforms.yaml | 16 ++++++++++++++++
config/crd/bases/camel.apache.org_integrations.yaml | 8 ++++++++
helm/camel-k/crds/crd-camel-catalog.yaml | 12 ++++++++----
helm/camel-k/crds/crd-integration-kit.yaml | 8 ++++++++
helm/camel-k/crds/crd-integration-platform.yaml | 16 ++++++++++++++++
helm/camel-k/crds/crd-integration.yaml | 8 ++++++++
pkg/apis/camel/v1/camelcatalog_types.go | 5 +++--
pkg/apis/camel/v1/integration_types.go | 2 ++
pkg/apis/camel/v1/integrationkit_types.go | 2 ++
pkg/apis/camel/v1/integrationplatform_types.go | 4 ++++
pkg/client/camel/clientset/versioned/fake/register.go | 14 +++++++-------
pkg/client/camel/clientset/versioned/scheme/register.go | 14 +++++++-------
16 files changed, 119 insertions(+), 38 deletions(-)
diff --git a/addons/strimzi/duck/client/internalclientset/fake/register.go b/addons/strimzi/duck/client/internalclientset/fake/register.go
index 53a4309e7..e6ac15499 100644
--- a/addons/strimzi/duck/client/internalclientset/fake/register.go
+++ b/addons/strimzi/duck/client/internalclientset/fake/register.go
@@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/addons/strimzi/duck/client/internalclientset/scheme/register.go b/addons/strimzi/duck/client/internalclientset/scheme/register.go
index 11f233b92..6abeca247 100644
--- a/addons/strimzi/duck/client/internalclientset/scheme/register.go
+++ b/addons/strimzi/duck/client/internalclientset/scheme/register.go
@@ -38,14 +38,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/config/crd/bases/camel.apache.org_camelcatalogs.yaml b/config/crd/bases/camel.apache.org_camelcatalogs.yaml
index 94fca4e8e..d389d9a23 100644
--- a/config/crd/bases/camel.apache.org_camelcatalogs.yaml
+++ b/config/crd/bases/camel.apache.org_camelcatalogs.yaml
@@ -39,13 +39,17 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- - description: The Camel K Runtime version
+ - description: The Runtime provider
+ jsonPath: .spec.runtime.provider
+ name: Runtime Provider
+ type: string
+ - description: The Runtime version
jsonPath: .spec.runtime.version
name: Runtime Version
type: string
- - description: The Camel K Runtime provider
- jsonPath: .spec.runtime.provider
- name: Runtime Provider
+ - description: The Camel version
+ jsonPath: .spec.runtime.metadata.camel\.version
+ name: Runtime Camel Version
type: string
- description: The catalog phase
jsonPath: .status.phase
diff --git a/config/crd/bases/camel.apache.org_integrationkits.yaml b/config/crd/bases/camel.apache.org_integrationkits.yaml
index f1d385a9f..eec22bb01 100644
--- a/config/crd/bases/camel.apache.org_integrationkits.yaml
+++ b/config/crd/bases/camel.apache.org_integrationkits.yaml
@@ -39,6 +39,10 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
+ - description: The integration kit alias
+ jsonPath: .metadata.labels.camel\.apache\.org\/kit\.alias
+ name: Alias
+ type: string
- description: The integration kit phase
jsonPath: .status.phase
name: Phase
@@ -47,6 +51,10 @@ spec:
jsonPath: .metadata.labels.camel\.apache\.org\/kit\.type
name: Type
type: string
+ - description: The integration kit layout
+ jsonPath: .metadata.labels.camel\.apache\.org\/kit\.layout
+ name: Layout
+ type: string
- description: The integration kit image
jsonPath: .status.image
name: Image
diff --git a/config/crd/bases/camel.apache.org_integrationplatforms.yaml b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
index c076777c8..d9bb04dc9 100644
--- a/config/crd/bases/camel.apache.org_integrationplatforms.yaml
+++ b/config/crd/bases/camel.apache.org_integrationplatforms.yaml
@@ -43,6 +43,22 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
+ - description: The default build strategy
+ jsonPath: .status.build.buildStrategy
+ name: Build strategy
+ type: string
+ - description: The default publish strategy
+ jsonPath: .status.build.publishStrategy
+ name: Publish strategy
+ type: string
+ - description: The container registry address
+ jsonPath: .status.build.registry.address
+ name: Registry address
+ type: string
+ - description: The default runtime version
+ jsonPath: .status.build.runtimeVersion
+ name: Default runtime
+ type: string
name: v1
schema:
openAPIV3Schema:
diff --git a/config/crd/bases/camel.apache.org_integrations.yaml b/config/crd/bases/camel.apache.org_integrations.yaml
index 56b14277f..693220cb5 100644
--- a/config/crd/bases/camel.apache.org_integrations.yaml
+++ b/config/crd/bases/camel.apache.org_integrations.yaml
@@ -43,6 +43,14 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
+ - description: The runtime version
+ jsonPath: .status.runtimeProvider
+ name: Runtime Provider
+ type: string
+ - description: The runtime provider
+ jsonPath: .status.runtimeVersion
+ name: Runtime Version
+ type: string
- description: The integration kit
jsonPath: .status.integrationKit.name
name: Kit
diff --git a/helm/camel-k/crds/crd-camel-catalog.yaml b/helm/camel-k/crds/crd-camel-catalog.yaml
index 94fca4e8e..d389d9a23 100644
--- a/helm/camel-k/crds/crd-camel-catalog.yaml
+++ b/helm/camel-k/crds/crd-camel-catalog.yaml
@@ -39,13 +39,17 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- - description: The Camel K Runtime version
+ - description: The Runtime provider
+ jsonPath: .spec.runtime.provider
+ name: Runtime Provider
+ type: string
+ - description: The Runtime version
jsonPath: .spec.runtime.version
name: Runtime Version
type: string
- - description: The Camel K Runtime provider
- jsonPath: .spec.runtime.provider
- name: Runtime Provider
+ - description: The Camel version
+ jsonPath: .spec.runtime.metadata.camel\.version
+ name: Runtime Camel Version
type: string
- description: The catalog phase
jsonPath: .status.phase
diff --git a/helm/camel-k/crds/crd-integration-kit.yaml b/helm/camel-k/crds/crd-integration-kit.yaml
index f1d385a9f..eec22bb01 100644
--- a/helm/camel-k/crds/crd-integration-kit.yaml
+++ b/helm/camel-k/crds/crd-integration-kit.yaml
@@ -39,6 +39,10 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
+ - description: The integration kit alias
+ jsonPath: .metadata.labels.camel\.apache\.org\/kit\.alias
+ name: Alias
+ type: string
- description: The integration kit phase
jsonPath: .status.phase
name: Phase
@@ -47,6 +51,10 @@ spec:
jsonPath: .metadata.labels.camel\.apache\.org\/kit\.type
name: Type
type: string
+ - description: The integration kit layout
+ jsonPath: .metadata.labels.camel\.apache\.org\/kit\.layout
+ name: Layout
+ type: string
- description: The integration kit image
jsonPath: .status.image
name: Image
diff --git a/helm/camel-k/crds/crd-integration-platform.yaml b/helm/camel-k/crds/crd-integration-platform.yaml
index c076777c8..d9bb04dc9 100644
--- a/helm/camel-k/crds/crd-integration-platform.yaml
+++ b/helm/camel-k/crds/crd-integration-platform.yaml
@@ -43,6 +43,22 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
+ - description: The default build strategy
+ jsonPath: .status.build.buildStrategy
+ name: Build strategy
+ type: string
+ - description: The default publish strategy
+ jsonPath: .status.build.publishStrategy
+ name: Publish strategy
+ type: string
+ - description: The container registry address
+ jsonPath: .status.build.registry.address
+ name: Registry address
+ type: string
+ - description: The default runtime version
+ jsonPath: .status.build.runtimeVersion
+ name: Default runtime
+ type: string
name: v1
schema:
openAPIV3Schema:
diff --git a/helm/camel-k/crds/crd-integration.yaml b/helm/camel-k/crds/crd-integration.yaml
index 56b14277f..693220cb5 100644
--- a/helm/camel-k/crds/crd-integration.yaml
+++ b/helm/camel-k/crds/crd-integration.yaml
@@ -43,6 +43,14 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
+ - description: The runtime version
+ jsonPath: .status.runtimeProvider
+ name: Runtime Provider
+ type: string
+ - description: The runtime provider
+ jsonPath: .status.runtimeVersion
+ name: Runtime Version
+ type: string
- description: The integration kit
jsonPath: .status.integrationKit.name
name: Kit
diff --git a/pkg/apis/camel/v1/camelcatalog_types.go b/pkg/apis/camel/v1/camelcatalog_types.go
index 112cb621d..cf23a23df 100644
--- a/pkg/apis/camel/v1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1/camelcatalog_types.go
@@ -32,8 +32,9 @@ const (
// +kubebuilder:resource:path=camelcatalogs,scope=Namespaced,shortName=cc,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
-// +kubebuilder:printcolumn:name="Runtime Version",type=string,JSONPath=`.spec.runtime.version`,description="The Camel K Runtime version"
-// +kubebuilder:printcolumn:name="Runtime Provider",type=string,JSONPath=`.spec.runtime.provider`,description="The Camel K Runtime provider"
+// +kubebuilder:printcolumn:name="Runtime Provider",type=string,JSONPath=`.spec.runtime.provider`,description="The Runtime provider"
+// +kubebuilder:printcolumn:name="Runtime Version",type=string,JSONPath=`.spec.runtime.version`,description="The Runtime version"
+// +kubebuilder:printcolumn:name="Runtime Camel Version",type=string,JSONPath=`.spec.runtime.metadata.camel\.version`,description="The Camel version"
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The catalog phase"
// CamelCatalog represents the languages, components, data formats and capabilities enabled on a given runtime provider. The catalog may be statically generated.
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index be9def47c..1aa7be885 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -34,6 +34,8 @@ import (
// +kubebuilder:storageversion
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The integration phase"
+// +kubebuilder:printcolumn:name="Runtime Provider",type=string,JSONPath=`.status.runtimeProvider`,description="The runtime version"
+// +kubebuilder:printcolumn:name="Runtime Version",type=string,JSONPath=`.status.runtimeVersion`,description="The runtime provider"
// +kubebuilder:printcolumn:name="Kit",type=string,JSONPath=`.status.integrationKit.name`,description="The integration kit"
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="The number of pods"
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index 4fa1d570d..abe34684f 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -32,8 +32,10 @@ import (
// +kubebuilder:resource:path=integrationkits,scope=Namespaced,shortName=ik,categories=kamel;camel
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
+// +kubebuilder:printcolumn:name="Alias",type=string,JSONPath=`.metadata.labels.camel\.apache\.org\/kit\.alias`,description="The integration kit alias"
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The integration kit phase"
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.metadata.labels.camel\.apache\.org\/kit\.type`,description="The integration kit type"
+// +kubebuilder:printcolumn:name="Layout",type=string,JSONPath=`.metadata.labels.camel\.apache\.org\/kit\.layout`,description="The integration kit layout"
// +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.status.image`,description="The integration kit image"
// IntegrationKit defines a container image and additional configuration needed to run an `Integration`.
diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go
index 2219f8c63..e2c0b2331 100644
--- a/pkg/apis/camel/v1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1/integrationplatform_types.go
@@ -68,6 +68,10 @@ type IntegrationPlatformStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The integration platform phase"
+// +kubebuilder:printcolumn:name="Build strategy",type=string,JSONPath=`.status.build.buildStrategy`,description="The default build strategy"
+// +kubebuilder:printcolumn:name="Publish strategy",type=string,JSONPath=`.status.build.publishStrategy`,description="The default publish strategy"
+// +kubebuilder:printcolumn:name="Registry address",type=string,JSONPath=`.status.build.registry.address`,description="The container registry address"
+// +kubebuilder:printcolumn:name="Default runtime",type=string,JSONPath=`.status.build.runtimeVersion`,description="The default runtime version"
// IntegrationPlatform is the resource used to drive the Camel K operator behavior.
// It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace.
diff --git a/pkg/client/camel/clientset/versioned/fake/register.go b/pkg/client/camel/clientset/versioned/fake/register.go
index 249a2b9e3..d55e6d595 100644
--- a/pkg/client/camel/clientset/versioned/fake/register.go
+++ b/pkg/client/camel/clientset/versioned/fake/register.go
@@ -40,14 +40,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
diff --git a/pkg/client/camel/clientset/versioned/scheme/register.go b/pkg/client/camel/clientset/versioned/scheme/register.go
index 9366fb20c..493d56e4c 100644
--- a/pkg/client/camel/clientset/versioned/scheme/register.go
+++ b/pkg/client/camel/clientset/versioned/scheme/register.go
@@ -40,14 +40,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
-// import (
-// "k8s.io/client-go/kubernetes"
-// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
-// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
-// )
+// import (
+// "k8s.io/client-go/kubernetes"
+// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
+// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
+// )
//
-// kclientset, _ := kubernetes.NewForConfig(c)
-// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
+// kclientset, _ := kubernetes.NewForConfig(c)
+// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.