-
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
Firewall uses v1 API if the priority is unset or has the default value. #500
Conversation
google/api_versions.go
Outdated
|
||
func defaultInUseFunc(d TerraformResourceData, path string, defaultValue interface{}) bool { | ||
// At read and delete time, there is no change. | ||
// At create time, all fields are marked has changed. We should only considered the feature active if the field has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: consider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
google/api_versions.go
Outdated
|
||
func updateInUseFunc(d TerraformResourceData, path string, defaultValue interface{}) bool { | ||
// During a resource update, if the beta field has changes, the feature is considered active even if the new value | ||
// is the default value. This is because the beta API must be call to change the value of the field back to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
google/api_versions_test.go
Outdated
@@ -29,7 +29,7 @@ func TestComputeApiVersion(t *testing.T) { | |||
Update: baseVersion, | |||
}, | |||
}, | |||
"beta fields no set": { | |||
"beta field no set": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
google/api_versions_test.go
Outdated
Update: baseVersion, | ||
}, | ||
}, | ||
"beta fields is being updated to default value": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
google/api_versions_test.go
Outdated
Update: baseVersion, | ||
}, | ||
}, | ||
"nested beta field is being updated default value": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: updated to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…e. (hashicorp#500) * api_versions supports default value * Firewall use v1 API if the priority is set to default value (1000)
…e. (hashicorp#500) * api_versions supports default value * Firewall use v1 API if the priority is set to default value (1000)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
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! |
Fixes #429
Right now, the
google_compute_firewall
always uses the beta API even if no beta fields are set.The is because the beta
priority
field has a default value set to 1000 in the schema. Even if you don't specify a value for thepriority
field, the field still has a value (the default value) andgetComputeApiVersion
orgetComputeApiVersionUpdate
consider that the field is used and returns that thev0beta
should be used.