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

Unable to use Kamelet spec in a custom CRD #1837

Closed
lburgazzoli opened this issue Dec 2, 2020 · 1 comment · Fixed by #1841
Closed

Unable to use Kamelet spec in a custom CRD #1837

lburgazzoli opened this issue Dec 2, 2020 · 1 comment · Fixed by #1841
Assignees
Labels
area/core Core features of the integration platform kind/bug Something isn't working

Comments

@lburgazzoli
Copy link
Contributor

I'm trying to use the Kamelet spec in a custom controller built using operator-sdk 1.2.x but it looks like the manifests cannot be built, to reproduce the issue:

  1. install controller-gen v0.4.1
  2. install a recent kustomize
  3. operator-sdk init --repo gihub.com/lburgazzoli/embedded-camel-k-cr
  4. operator-sdk create api --group=example --version=v1alpha1 --kind=MyType
  5. add a Field of type KameletSpec to your spec, like:
// MyTypeSpec defines the desired state of MyType
type MyTypeSpec struct {
	Kamelet *camelv1alpha1.KameletSpec `json:"kamelet,omitempty"`
}
  1. run make manifests and you should get an error like:
$ make manifests 
controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
gihub.com/lburgazzoli/embedded-camel-k-cr/api/v1alpha1:-: conflicting types in allOf branches in schema: string vs object
Error: not all generators ran successfully
run `controller-gen crd:trivialVersions=true rbac:roleName=manager-role webhook paths=./... output:crd:artifacts:config=config/crd/bases -w` to see all available markers, or `controller-gen crd:trivialVersions=true rbac:roleName=manager-role webhook paths=./... output:crd:artifacts:config=config/crd/bases -h` for usage
make: *** [Makefile:58: manifests] Error 1
@lburgazzoli lburgazzoli added the kind/bug Something isn't working label Dec 2, 2020
@astefanutti
Copy link
Member

It seems related to the JSONSchemaProps field in KameletSpec.

This used to work in controller-gen v0.4.0, and I suspect this is caused by kubernetes-sigs/controller-tools@f8684f4.

@astefanutti astefanutti added the area/core Core features of the integration platform label Dec 3, 2020
@astefanutti astefanutti self-assigned this Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Core features of the integration platform kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants