Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1556 - Add the camel category to Camel K CRDs #1615

Conversation

ipolyzos
Copy link
Contributor

Added 'kamel' & 'camel' categories to Camel-K CRDs (i.e Build, CamelCatalog, Integration, IntegrationKit)

Please see below example usage:

$ kamel install 
Camel K installed in namespace myproject 

$ kubectl get kamel
NAME                                           PHASE
integrationplatform.camel.apache.org/camel-k   

$ kubectl get camel
NAME                                           PHASE
integrationplatform.camel.apache.org/camel-k   

$ kamel run examples/simple.groovy 
integration "simple" created

$ kubectl get kamel                                       
NAME                                           PHASE
integrationplatform.camel.apache.org/camel-k   

NAME                                  PHASE   KIT   REPLICAS
integration.camel.apache.org/simple                 

Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following #1582, the CRDs are generated from the APIs. Could you declare the categories in the types using // +kubebuilder:resource:categories=<[]string>, as documented in https://book.kubebuilder.io/reference/markers/crd.html.

Also, could you confirm categories are supported by apiextensions.k8s.io/v1beta1?

@ipolyzos ipolyzos force-pushed the #1556-add-the-camel-category-to-camel-k-crds branch 2 times, most recently from e160833 to 9ba54c8 Compare July 15, 2020 18:35
@ipolyzos
Copy link
Contributor Author

@astefanutti thanks for the review.

I have appended the code to generate categories in the types based on the docs provided. It would be great if you could take a look, please.

Also, I could confirm that categories are supported by apiextensions.k8s.io/v1beta1 based on the link provided in #1556.

Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Categories must be appended in the existing marker, e.g.:

// +kubebuilder:resource:path=integrations,scope=Namespaced,shortName=it,categories=kamel;camel

Otherwise, the generation tool just takes the latest one.

You can test by running make generate-crd.

@ipolyzos ipolyzos force-pushed the #1556-add-the-camel-category-to-camel-k-crds branch from 9ba54c8 to 1e885a5 Compare July 16, 2020 14:01
@ipolyzos
Copy link
Contributor Author

ipolyzos commented Jul 16, 2020

// +kubebuilder:resource:path=integrations,scope=Namespaced,shortName=it,categories=kamel;camel

Thank you for the advice, I have applied the change and the tests seems to work fine.

Please see below for the test run:

$grep -A2 "categories*[kamel|camel]*" deploy/crds/camel.apache.org_*                  
deploy/crds/camel.apache.org_builds.yaml:    categories:
deploy/crds/camel.apache.org_builds.yaml-    - kamel
deploy/crds/camel.apache.org_builds.yaml-    - camel
--
deploy/crds/camel.apache.org_camelcatalogs.yaml:    categories:
deploy/crds/camel.apache.org_camelcatalogs.yaml-    - kamel
deploy/crds/camel.apache.org_camelcatalogs.yaml-    - camel
--
deploy/crds/camel.apache.org_integrationkits.yaml:    categories:
deploy/crds/camel.apache.org_integrationkits.yaml-    - kamel
deploy/crds/camel.apache.org_integrationkits.yaml-    - camel
--
deploy/crds/camel.apache.org_integrationplatforms.yaml:    categories:
deploy/crds/camel.apache.org_integrationplatforms.yaml-    - kamel
deploy/crds/camel.apache.org_integrationplatforms.yaml-    - camel
--
deploy/crds/camel.apache.org_integrations.yaml:    categories:
deploy/crds/camel.apache.org_integrations.yaml-    - kamel
deploy/crds/camel.apache.org_integrations.yaml-    - camel

@ipolyzos ipolyzos force-pushed the #1556-add-the-camel-category-to-camel-k-crds branch from 1e885a5 to b4e7cbf Compare July 16, 2020 14:05
pkg/apis/camel/v1/build_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/camelcatalog_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/integration_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/integrationkit_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/integrationplatform_types.go Outdated Show resolved Hide resolved
@ipolyzos ipolyzos force-pushed the #1556-add-the-camel-category-to-camel-k-crds branch from b4e7cbf to cca508d Compare July 16, 2020 14:23
@ipolyzos ipolyzos force-pushed the #1556-add-the-camel-category-to-camel-k-crds branch from cca508d to 486e0ef Compare July 16, 2020 14:31
pkg/apis/camel/v1/build_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/camelcatalog_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/integration_types.go Outdated Show resolved Hide resolved
pkg/apis/camel/v1/integrationkit_types.go Outdated Show resolved Hide resolved
Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@astefanutti astefanutti merged commit e97e3e2 into apache:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants