-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Converts clusters with one replication_specs, regions_config and shard #16
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
Conversation
# but plugin doesn't help here. | ||
ignore_changes = [provider_instance_size_name] | ||
} | ||
backup_enabled = true |
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.
note that they are some empty lines that are added where replication_specs and regions_config were, and new attributes are added at the end of current resource , in this case after lifecycle
.
will see if it can be improved in following PRs
nConfigSrc = "regions_config" | ||
nElectableSpecs = "electable_specs" | ||
nAutoScaling = "auto_scaling" | ||
nRegionNameSrc = "provider_region_name" |
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.
added Src when the cluster attr name is different to adv_cluster, so it's easier to see the equivalence
|
||
func getElectableSpecs(configSrc *hclwrite.Block, root attrVals) (hclwrite.Tokens, error) { | ||
file := hclwrite.NewEmptyFile() | ||
fileb := file.Body() |
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.
specBlock?
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.
specBlock for which var you mean?
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.
instead of fileb
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.
b is for body,
I'm using file as it's how HCL library calls it, instead of calling electableSpecs inside getElectableSpecs, scalingSpecs in getAutoScalingOpt, etc. as we're inside that func so it's implicit what block we're working with
|
||
|
||
|
||
lifecycle { // To simulate if there a new instance size name to avoid scale cluster down to original 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.
I would prefer having lifecycle at the end, but understand it is because we are appending to the resource block?
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.
correct, when the functionality is done, we can try to improve these formatting issues
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've created this ticket: CLOUDP-299208
"configuration_file_error": "failed to parse Terraform config file", | ||
"free_cluster_missing_attribute": "free cluster (because no replication_specs): attribute backing_provider_name not found" | ||
"free_cluster_missing_attribute": "free cluster (because no replication_specs): attribute backing_provider_name not found", | ||
"autoscaling_missing_attribute": "setting replication_specs: attribute provider_instance_size_name not found" |
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.
Love this!
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.
nice!
Description
Converts clusters with one replication_specs, regions_config and shard
Link to any related issue(s): CLOUDP-298699
Type of change:
Required Checklist:
Further comments