-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_cloud_run_service: status
field should have MaxItems
set to 1
#9771
Comments
@cakoose below is the api that defines what https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services#ServiceStatus |
Oh, sorry, I wasn't clear. Here's the full reasoning: The GCP Cloud Run In Terraform, the My understanding of the Terraform schema language is a few years old, but:
All I'm saying is that I think the |
Ah I think I see what you're saying:
The reason it would still be useful for to set |
Note that I am fairly certain SDKv2 disallows doing this, as we used to have it: https://github.com/hashicorp/terraform-provider-google-beta/blame/858167e3bf28e4f2fd111d8cb8b17521ef2156f7/google-beta/resource_cloud_run_service.go#L250 |
Oh, looks like you are right: https://www.terraform.io/docs/extend/guides/v2-upgrade-guide.html#stronger-validation-for-helper-schema-schema-computed-fields That's unfortunate, but changing that decision is probably way too hard at this point :-\ Either way, thank you so much for getting to the bottom of it! Tangent: Do you have an opinion on the lack of direct support for nested fields? I was surprised when I found this out ~5 years ago and am surprised that it still hasn't been added. But I assume you know Terraform much better than I do -- is there a reason for this? |
I think the model of Terraform Core assumed that fields were either a primitive or had multiple elements, and didn't account for a nested object type early on, and that got carried forward. There used to be a As of Also, closing as infeasible. |
Not sure I follow -- does this mean that newer SDKs will be based on a different schema language? Or will the existing schema language be enhanced to support a nested object? Is there somewhere I can read more about the progress here? |
New schema language if that means what I think, yep. https://www.terraform.io/docs/plugin/framework/index.html, https://github.com/hashicorp/terraform-plugin-go are good references. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
N/A. I'm using Pulumi, which uses the Terraform source code. The bug I'm reporting is based on the Terraform source code.
Affected Resource(s)
Terraform Configuration Files
N/A
Debug Output
N/A
Panic Output
N/A
Expected Behavior
The
status
field should haveMaxItems
set to 1. For example, themetadata
andspec
fields haveMaxItems
to 1.Actual Behavior
The
MaxItems
attribute is not set: https://github.com/hashicorp/terraform-provider-google-beta/blob/11c674f5f4edf7e87c2d1c94cfb0d69cde7b9af4/google-beta/resource_cloud_run_service.go#L680Steps to Reproduce
N/A
Important Factoids
N/A
References
The GCP API definition of the Cloud Run
Service
object: link.metadata
,spec
, andstatus
are all non-repeating fields. However in Terraform, onlymetadata
andspec
haveMaxItems
set to 1.My original bug report against the Pulumi project: pulumi/pulumi#7634
A tangentially-related bug report about the
status
field: #8728The text was updated successfully, but these errors were encountered: