-
Notifications
You must be signed in to change notification settings - Fork 87
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
panic generating crd: invalid schema type TypeInvalid #372
Comments
did you tried v1.2.3 for upjet ? today its only as tag created |
@haarchri I have the same issue with provider-ovh, trying to update the terraform provider to last version I got the same error, because of a new created resource that have a make generate
14:23:32 [ .. ] generating provider schema for ovh/ovh 0.39.0
14:23:33 [ OK ] generating provider schema for ovh/ovh 0.39.0
14:23:33 [ .. ] verify go modules dependencies have expected content
all modules verified
14:23:33 [ OK ] go modules dependencies verified
14:23:34 [ .. ] go generate linux_arm64
panic: cannot generate crd for resource ovh_cloud_project_alerting: cannot build types for ProjectAlerting: cannot build the Types for resource "ovh_cloud_project_alerting": cannot infer type from schema of field formatted_monthly_threshold: invalid schema type TypeInvalid
go.mdmodule github.com/edixos/provider-ovh
go 1.22.0
toolchain go1.22.1
require (
github.com/crossplane/crossplane-runtime v1.14.0-rc.0.0.20231011070344-cc691421c2e5
github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79
github.com/crossplane/upjet v1.2.3
github.com/pkg/errors v0.9.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
k8s.io/apimachinery v0.30.0-beta.0
k8s.io/client-go v0.28.2
sigs.k8s.io/controller-runtime v0.16.2
sigs.k8s.io/controller-tools v0.13.0
)
... |
I am still getting the same error on v1.2.3 as well. |
@jaylevin @smileisak unfortunately upjet does not support |
Thanks for the update, is this feature already in progress or are we still looking for a contributor? |
Hi 👋 |
Same problem here |
Problem still persists in 1.4.0, joining the question |
I get the same error message when creating the gitlab_group_access_token crds using upjet v1.4.1.
rotation_configuration is from typ "Attributes". |
I get the same error message when creating the platform_oidc_identity_mapping crds using upjet v1.4.0. Is there already a road map for supporting nested attributes? |
We will discuss this topic at the next Upjet SIG meeting on Aug 14: https://docs.google.com/document/d/1QJfsAk-pdo_j2cKsJtG6W-BOQh_3ilhiRVTYVIGkDXM/edit |
@jeanduplessis was anything done / mentioned on the issue on the meeting ? I can't see any updates in the document about it. |
We discussed the topic off-channel with @ulucinar and @erhancagirici separately. Let me summarize as best as I can. Upjet deserializes provider schema from Unfortunately, Plugin Framework resources that contain blocks or nested attributes in their schemas cannot be deserialized. Handling such a deserialization doesn't seem to be straightforward. The ideal solution would be to deserialize each resource type into its own schema type, i.e., deserialize Plugin SDK resources into a Plugin SDK schema and Plugin Framework resources into a Plugin Framework schema. Doing so would require architectural changes to code generation pipeline, which is currently oblivious to the resource types — code generation works with only the Plugin SDK schema, which is why all resources are deserialized into one. A less-substantial solution would involve finding a way of deserializing blocks and nested attributes into a Plugin SDK schema. Doing so would still require special handling of those fields in code generation, but at least the effort would, hopefully, be less compared to the ideal solution. We didn't discuss the topic in the meeting, because we prioritized the topics of the attendees. We welcome anyone to the meetings for further discussion. |
This commit is the result of following the instructions in the page: https://github.com/crossplane/upjet/blob/main/docs/generating-a-provider.md Step 4 of "Configure the Provider Resources" (`make generate`) fails due to a bug in the Upjet generator that prevents nested attributes from being used (crossplane/upjet#372).
hello, I'm blocked as well here while trying to generate crossplane-provider from this terraform provider: https://registry.terraform.io/providers/exoscale/exoscale/latest can be used as a test case :) I'd like to ask You to put some more attention into this issue. Best regards |
+1 to the list of blocked people :) Maybe you can suggest some workaround, like manually generating missing types? Or annotating somehow these nested blocks so code pipeline can reason from them? Or... just assume it's an object type with "preserve unknown fields" annotation in CRD, this way we can at least generate most of the work and then do workarounds manually. |
+1 |
+1 |
What happened?
I am trying to generate a new Upjet provider from the Elastic Cloud Terraform Provider.
The first resource I would like to generate is
ec_deployment
but I am encountering an error duringmake generate
:The only related issue I could find was #121, but it looks like that issue was fixed by #130 and released in the latest version of upjet (that I'm using): v1.1.0.
How can we reproduce it?
Try running
make generate
in the repository: https://github.com/jaylevin/provider-elastic-cloudSchema.json: https://github.com/jaylevin/provider-elastic-cloud/blob/main/config/schema.json
Any help would be greatly appreciated, thanks in advance 😃
The text was updated successfully, but these errors were encountered: