-
Notifications
You must be signed in to change notification settings - Fork 992
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
kubernetes_manifest resource warns OpenAPI schema not recognised and updates will force recreation #1382
Comments
any news on this issue? we are facing the same problem with IstioOperator CRD. |
@ls-sajad-sameti I'm pretty sure this is an issue with Istio not providing the Schema in the CRD correctly. |
We experienced the same with Longhorn or it's CRD altough it is installed in our cluster we get this warning. |
@scbay It's not about the CRD being missing from your cluster (if it was, you would not be able to create the object at all). You receive this warning because some CRD authors unfortunately leave the schema unspecified in the CRD definition (so it's basically just a freeform object), which prevents validation of the object you create with The "proper" solution is to ask your vendor to please fix their CRDs to follow best practices. Unfortunately many vendors can't or won't produce good quality CRDs. If the warning is accompanied by some other problem (@Doug-North said "Actual behaviour: Warning, and a resource that for me is not usable" but didn't expand on what "not usable" meant), the other problem is likely unrelated to the warning. I'd love if there was a way to silence the warning. We have some vendor CRDs which have this problem and the persistent warning is annoying. Something like |
I have the same problem with the
I'm not familiar with Open API Schema so I don't know what's wrong with this openAPIV3Schema, is terraform right or wrong when it says that there is no OpenAPI schema for this CRD? |
There is no schema in that CRD. |
The CRD has a '.spec.versions[0].schema.openAPIV3Schema', is not that the schema?
seems like the one of the examples that they give in the Kubernetes Documentation for OpenAPI v3 validation schema. I though that "openAPIV3Schema" meant that the value must be an object, and nothing else. Do you mean that is not right kind of schema? Is there any good example of an actual CRD that can be managed with |
This is not a schema. All it says is that the object is an object. All objects are objects!
Do note that you can manage this CRD with Here's an example of the |
As jbg explained, the CRD examples quoted here don't include valid schema information. What ecerulm quoted as schema is actually just the placeholder attribute for the schema, but it's contents are empty (x-kubernetes-preserve-unknown-fields: true is a wildcard to mark the absence of schema). Whenever we encounter this kind of CRDs, we have no other choice but to force re-creation on updates since we cannot guarantee the consistency of the resource schema across updates, which is a hard requirement by Terraform (checked and enforced after each apply). I'm going to close this issue, but if anyone thinks the error message is not descriptive enough, please speak up. |
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
It all checks out - just not the OpenAPI warning.
Debug Output
Steps to Reproduce
terraform apply
-->Expected Behavior
No warning - and for the OpenApi schema defined in CRD to be recognised
Actual Behavior
Warning, and a resource that for me is not usable.
Important Factoids
References
Community Note
The text was updated successfully, but these errors were encountered: