-
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
Add versioned Beta support to google_compute_instance_group_manager #234
Add versioned Beta support to google_compute_instance_group_manager #234
Conversation
…pport (hashicorp#129) * Refactor resource_compute_instance_group_manager for multi version support. * Minor changes based on review. * Removed type-specific API version conversion functions.
…sion resources don't see diffs.
I just caught an issue that wasn't failing before and is now; The last 2 commits still need to be reviewed, the rest were covered in past pull requests. |
Just finished my local test run and all of them are passing now. |
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.
Before this or other Beta features are merged I would like to see some documentation on how users will be exposed to this and expected to use it. Specifically:
- is the idea to document specific attributes as
Beta
and users are implicitly opting in by specifying that attribute? - are these features likely to change or be not as reliable as Production features?
- what is the plan for promoting these attributes to production ready, non-beta status?
- what is the plan for breaking changes to beta attributes?
Hi @catsby! I'm not sure where this kind of documentation would live yet; if you have a good idea of where it should go, I'd love the advice. It doesn't seem to fit with the main provider page, which is about authentication, for example. For now, to go over your questions; 1 - Enrolling in Beta FeaturesUsers of the Terraform GCP Provider will enroll in Beta features implicitly by using fields that are marked Beta in the documentation. Resources that are considered to be in Beta will use the v0beta endpoints of the Compute API, instead of the v1 endpoints. While this has not been realised yet, some resources may begin supporting the Update operation only in the Beta API for fields that are otherwise GA. When this is the case, or if it has explicit demand, support for a provider-level “GA-only” field will be added that a user can set to cause Terraform to return an error if it would have used a non-GA Compute API (in case the customer has a strict need for GA-only features/APIs). When the support for custom diffs has evolved in Terraform’s core/helper libraries, we will investigate populating diffs with information about what API is being used. 2 - Beta Feature ReliabilityGCP does not offer SLAs for features in Beta; they are not necessarily going to be as reliable as GA resources. As highlighted in the GCP Launch Stages documentation, Beta releases tend to be feature-complete but may be more unstable than a release in GA, with some open outstanding issues still present. In practice, this should mean that Beta releases are stable & reliable releases, especially if they have been in Beta for some amount of time. 3 - Feature PromotionWhen a feature is promoted to GA from Beta, we will remove the “Beta” tag in documentation and remove the field from the list of Beta fields in code. The next time Terraform performs a refresh, it will implicitly be read as a GA resource, and operations will be performed against GA APIs again. 4 - Breaking ChangesBreaking changes are less of a concern for Beta releases from GCP than the label Beta might suggest; as shown in Launch Stages, any Beta release will be feature complete and should not surface breaking changes on the path to GA outside of extraordinary circumstances. Beta releases are the time that a GCP feature has entered the public eye. While we don’t present an SLA or deprecation policy for Beta features, that doesn’t necessarily mean that they will go without a deprecation period. For example, Managed Instance Group Updates, an Alpha feature, has gone through a deprecation period beginning in September 2016 that is still ongoing: from rolling updates to managed instance groups to updating managed instance groups. Major breaking changes for Beta features can be handled on a case by case basis; if a feature is removed entirely, we will need to deprecate and remove it quickly, generating a major version out of schedule if necessary. If a feature is renamed/replaced, we will prioritise adding support for the new version, deprecating the old one, and removing it when appropriate. |
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.
I'm happy with this, though we should probably wait on a response from @catsby before merging.
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.
My primary concern is the UX when enabling/using Beta features. I'm not immediately aware of other instances in Terraform where Beta features are used yet, but I want to keep the usage consistent. Perhaps even as far as a boolean field in the schema that will automatically present a notice to the user that they are using a Beta feature, but we can cross that bridge later I suppose.
No fields are v0beta yet, so it will not enter that state
👍
I would appreciate a ping on any future PRs that actually introduce beta attributes, if that's not too much to ask 😄
The rest LGTM
return namedPorts | ||
} | ||
|
||
var InstanceGroupManagerBaseVersion = v1 |
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.
Can we bump this up to above the schema declaration? It's kind of tucked away here on line 147, all by itself.
Also, but not required, I'd name it something that describes it's function/intent better, so specifically calling out that we're setting the base API version that the resource is talking to. Without getting too wordy, something like igmBaseAPIVersion
. Not required though.
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.
@catsby: Will do! Tests: ==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccInstanceGroupManager_ -timeout 120m
=== RUN TestAccInstanceGroupManager_importBasic
--- PASS: TestAccInstanceGroupManager_importBasic (265.09s)
=== RUN TestAccInstanceGroupManager_importUpdate
--- PASS: TestAccInstanceGroupManager_importUpdate (212.84s)
=== RUN TestAccInstanceGroupManager_basic
--- PASS: TestAccInstanceGroupManager_basic (221.84s)
=== RUN TestAccInstanceGroupManager_targetSizeZero
--- PASS: TestAccInstanceGroupManager_targetSizeZero (45.23s)
=== RUN TestAccInstanceGroupManager_update
--- PASS: TestAccInstanceGroupManager_update (277.79s)
=== RUN TestAccInstanceGroupManager_updateLifecycle
--- PASS: TestAccInstanceGroupManager_updateLifecycle (105.11s)
=== RUN TestAccInstanceGroupManager_updateStrategy
--- PASS: TestAccInstanceGroupManager_updateStrategy (211.10s)
=== RUN TestAccInstanceGroupManager_separateRegions
--- PASS: TestAccInstanceGroupManager_separateRegions (212.83s)
PASS
ok github.com/terraform-providers/terraform-provider-google/google 1552.027s |
…ashicorp#234) * Vendor GCP Compute Beta client library. * Refactor resource_compute_instance_group_manager for multi version support (hashicorp#129) * Refactor resource_compute_instance_group_manager for multi version support. * Minor changes based on review. * Removed type-specific API version conversion functions. * Add support for Beta operations. * Add v0beta support to google_compute_instance_group_manager. * Renamed Key to Feature, added comments & updated some parameter names. * Fix code and tests for version finder to match fields that don't have a change. * Store non-v1 resources' self links as v1 so that dependent single-version resources don't see diffs. * Fix weird change to vendor.json from merge. * Add a note that Convert loses ForceSendFields, fix failing test. * Moved nil type to a switch case in compute_shared_operation.go. * Move base api version declaration above schema.
…ashicorp#234) * Vendor GCP Compute Beta client library. * Refactor resource_compute_instance_group_manager for multi version support (hashicorp#129) * Refactor resource_compute_instance_group_manager for multi version support. * Minor changes based on review. * Removed type-specific API version conversion functions. * Add support for Beta operations. * Add v0beta support to google_compute_instance_group_manager. * Renamed Key to Feature, added comments & updated some parameter names. * Fix code and tests for version finder to match fields that don't have a change. * Store non-v1 resources' self links as v1 so that dependent single-version resources don't see diffs. * Fix weird change to vendor.json from merge. * Add a note that Convert loses ForceSendFields, fix failing test. * Moved nil type to a switch case in compute_shared_operation.go. * Move base api version declaration above schema.
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! |
Split of #198 - Part 1/2
Add support for multiple versions to
google_compute_instance_group_manager
, by adding simultaneous support forv1
andv0beta
. No fields arev0beta
yet, so it will not enter that state. SettingInstanceGroupManagerBaseVersion
tov0beta
instead ofv1
will allow you to test the beta code.This is the first versioned resource for #93
@danawillow