-
Notifications
You must be signed in to change notification settings - Fork 989
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
"Warning: Attribute not found in schema" after updating CRD #2126
Comments
Facing the same issue after upgrading from 1.22 to 1.25 Kubernetes.
Terraform version: 1.5.5 |
Any updates on this ?Facing the same issue.
|
Same issue. Did anyone figure out how to get around this? |
It seems some people simply use Example from a fine module for cert-manager:
However, having to implement these workaround kind of defeats some of the benefits of terraform, making code unnecessarily complex... It would be great if |
I had the same issue while updating the The underlying problem I think it's the removal of My workaround has been to remove the two # Show existing resources in tf state
terragrunt state list
# helm_release.cert_manager
# kubernetes_manifest.prod_issuer[0]
# kubernetes_manifest.staging_issuer[0]
# kubernetes_namespace.cert_manager
# kubernetes_secret.azuredns_credentials[0]
# Delete cluster issuers from tf state
terragrunt state rm kubernetes_manifest.staging_issuer[0]
terragrunt state rm kubernetes_manifest.prod_issuer[0]
# Import them back
terragrunt import kubernetes_manifest.staging_issuer[0] "apiVersion=cert-manager.io/v1,kind=ClusterIssuer,name=letsencrypt-staging"
terragrunt import kubernetes_manifest.prod_issuer[0] "apiVersion=cert-manager.io/v1,kind=ClusterIssuer,name=letsencrypt-prod"
# Final apply
terragrunt apply After this operation the problem was gone |
This is abandoned, I would not rely on it. I don't know how this hasn't received any attention so far. Having to remove those resources from the state and import them is ridiculous. |
I have the same issue with a manifest containing a SealedSecret. I got as error: |
Issue still exist with latest kubernetes provider 2.25.2
|
Issue still exist with kubernetes provider 2.26.0
|
Still a problem in 2.31.0... |
And still a problem in 2.34.0 |
Hi. Without knowing all that much about Kubernetes or Terraform, I'd assume this is probably related to a CRD being updated and removing an attribute that's being tracked in tf state. I can imagine removed attributes will cause a something naïve like this: (via morph.go) diff --git a/manifest/morph/morph.go b/manifest/morph/morph.go
index 36f14666..44d3c846 100644
--- a/manifest/morph/morph.go
+++ b/manifest/morph/morph.go
@@ -597,6 +597,10 @@ func morphObjectToType(v tftypes.Value, t tftypes.Type, p *tftypes.AttributePath
elp := p.WithAttributeName(k)
nt, ok := t.(tftypes.Object).AttributeTypes[k]
if !ok {
+ if v.IsNull() {
+ // Who cares if it doesn't exist? It's null anyway.
+ continue
+ }
diags = append(diags, &tfprotov5.Diagnostic{
Attribute: p,
Severity: tfprotov5.DiagnosticSeverityWarning, |
Terraform version, Kubernetes provider version and Kubernetes version
Terraform configuration
I'm using
kubernetes_manifest
to define a custom resource for which the CRD is already installed. The CRD in question is from https://github.com/external-secrets/external-secrets/blob/main/deploy/crds/bundle.yaml.Question
After updating to a newer version of the CRD,
terraform plan
continuously warns about attributes not found in schema, for example, "Unable to find schema type for attribute: spec.provider.alibaba.endpoint." It appears this is an attribute that used to exist in the CRD, but no longer does (external-secrets/external-secrets@59f5759#diff-39388de29a1b8f0becdcbbb94fc710b76b21c4fb71e769d523d6bbede3f1feb7L38).Inspecting the state file, the
object
attribute of thekubernetes_manifest.secret_store
resource has defaults populated for a number of fields, including thealibaba
one that Terraform is complaining about:To be clear, we do not set these
alibaba
fields. Terraform has populated them, presumably when the fields were defined in the CRD, and is now complaining about the presence of fields that are no longer in the CRD.So my question is, how do I fix this?
Potential solutions:
Either way, it seems like there should be an easier solution for this.
The text was updated successfully, but these errors were encountered: