Closed rileykarson closed 10 months ago
This means that I don't think that that upgrade path is possible- and a user that attempts to resolve the deprecation warning is likely to accidentally set binary_authorization.enabled to false, disabling binary authorization on their cluster regardless of their evaluation_mode setting.
I don't think this is right, if the user passes both an evaluation mode and enabled bool the evaluation mode has precedence.
I don't think this is right, if the user passes both an evaluation mode and enabled bool the evaluation mode has precedence.
In the API, or Terraform specifically? I think that Terraform is always sending an explicit value to the API.
Request/response:
{
"update": {
"desiredBinaryAuthorization": {
"enabled": false,
"evaluationMode": "PROJECT_SINGLETON_POLICY_ENFORCE"
}
}
}
"binaryAuthorization": {
"evaluationMode": "PROJECT_SINGLETON_POLICY_ENFORCE",
"policy": ""
},
That does mean that an explicit false is not a problem. Note that enabled
cannot be true at the same time as evaluationMode is set.
To set BinaryAuthorization.EvaluationMode, leave the deprecated BinaryAuthorization.Enabled field unset.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
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
Debug Output
Panic Output
Expected Behavior
Binary authorization remains enabled
Actual Behavior
Binary authorization is disabled
Steps to Reproduce
terraform apply
Important Factoids
In
5.0.0
we deprecatedenable_binary_authorization
in favour ofbinary_authorization.enabled
: https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/version_5_upgrade#enable_binary_authorization-is-now-removedHowever, the field that we directed folks to was introduced as deprecated in https://github.com/GoogleCloudPlatform/magic-modules/pull/6101 and pointed folks to a different field,
binary_authorization.evaluation_mode
. In the API if you send just that field the API will determineenabled
based on its value (and has deprecated setting enablement explicitly). Our implementation always sends an enabled field, which appears to override the value.This means that I don't think that that upgrade path is possible- and a user that attempts to resolve the deprecation warning is likely to accidentally set
binary_authorization.enabled
tofalse
, disabling binary authorization on their cluster regardless of theirevaluation_mode
setting.We should update our
5.0.0
upgrade guide to warn against specifying justevaluation_mode
, and either remove the deprecation clientside until we handle it properly or fix our handling.References
b/315582550