-
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
Cloud run memory does not reset to default #8456
Comments
It's a In your apply 2 (update), you removed the field from the config and tf/provider don't see any change at this point. Provider can't differentiate between an unmanaged field and user removed that field in the config post Create. So no Update call is made to the API. By explicitly changing the |
I guess it depends on the responsibilities of the google terraform provider. My assumption is that the same TF config = the same provisioned cloud components. (To me this is the selling point of config as code, as you don't need to worry about the state of the infrastructure to set it to the desired end state). This is not true with the cloud run memory example in that if you went straight to step 2 config, you get a different result than going step 1 then step 2, when the final config is the same. Perhaps there is precedent in other components? I would assume that removing settings from TF config would reset them back to the default settings. |
I would argue that a TF config without a certain field in it means that you don't care what that value is. In most resources this means that the value takes the default value either set in the provider or by the API, but if the value has been changed from that default it will keep its current value as in your example. From our side this is a necessity for fields that are marked as In the case of cloud run resource limits, it looks like this is marked as Optional and Computed because there are default values set by the API for both memory and CPU limits. Without being marked Computed this field would show a diff unless you specified the same default values in your config as the API sets. So, the possible solution for this would be removing the The other possibility is for you to explicitly specify in your config that there should be no limits: limits = {
"cpu" = "1000m"
"memory" = "256Mi"
} or similar. Closing this bug as we do not want to support resetting to default when the block is removed in this case. |
Ok thanks for the response. |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
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
Affected Resource(s)
Terraform Configuration Files
First apply
Then apply
Debug Output
First run setting memory (and new docker image):
Second run resetting back to default:
Panic Output
Expected Behavior
The cloud run service should go back to the default memory limit of 256MB.
Actual Behavior
The cloud run service remained on the memory limit of 512MB. In the YAML looking via the google console you can still see:
Steps to Reproduce
terraform apply
setting cloud run memory to non defaultterraform apply
again, removing the configured memory setting.Important Factoids
References
The text was updated successfully, but these errors were encountered: