-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Bug]: Creation of compute Instances (and others) fails with SetNew only operates on computed keys
#472
Comments
Hi @JonathanO, Thank you for bringing up this issue, I can reproduce the issue with the provided information.
logs:
|
For already created resources it's the same:
I faced with the problem on these resources:
|
We have investigated the root cause of this issue with @sergenyalcin. upjet's func MarkAsRequired(sch *schema.Resource, fieldpaths ...string) {
for _, fieldpath := range fieldpaths {
if s := GetSchema(sch, fieldpath); s != nil {
s.Computed = false
s.Optional = false
}
}
} Setting It turns out that interfering with the native schema has adverse affects here. The GCP project and zone defaulting functions introduced as However, We had better get rid of all the Terraform schema modifications as they can potentially cause harmful interference with the Terraform runtime like this issue demonstrates. We have plans to remove the Terraform plugin SDK from upjet's code generation pipelines, which will enforce this. Till then, we must be very careful (and avoid as much as possible) modifying the Terraform schema for managed resource configuration. |
Is there an existing issue for this?
Affected Resource(s)
Resource MRs required to reproduce the bug
examples/compute/instance.yaml
examples/cloudscheduler/job.yaml
Steps to Reproduce
Apply examples/compute/instance.yaml (or examples/cloudscheduler/job.yaml)
What happened?
External resource was not created, reconciliation fails with an error from terraform:
observe failed: cannot compute the instance diff: failed to get *terraform.InstanceDiff: SetNew only operates on computed keys - zone is not one
(For Job it's
... - region is not one
)Relevant Error Output Snippet
No response
Crossplane Version
1.15.0
Provider Version
1.0.0
Kubernetes Version
No response
Kubernetes Distribution
No response
Additional Info
The failing calls to SetNew appear to have been introduced in GoogleCloudPlatform/magic-modules#8569
The text was updated successfully, but these errors were encountered: