-
Notifications
You must be signed in to change notification settings - Fork 205
test: Updates all test workflows to use advanced_cluster TPF implementation #3580
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
Merged
maastha
merged 11 commits into
CLOUDP-320243-dev-2.0.0
from
CLOUDP-336437-fix-test-suite
Aug 14, 2025
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8dd6255
fix
maastha a9f8fb5
fix
maastha 177581e
fix
maastha e9d1239
nit
maastha f419e76
nit
maastha dc53484
init
maastha 95c3428
revert
maastha 1062349
fmt
maastha 1bf0f23
nit
maastha 0bcb43e
nit
maastha 4358b36
pr cmt
maastha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,6 @@ func writeReplicationSpec(cluster *hclwrite.Body, specs []admin.ReplicationSpec2 | |
"provider_name": cty.StringVal(*rc.ProviderName), | ||
"region_name": cty.StringVal(*rc.RegionName), | ||
} | ||
|
||
if rc.BackingProviderName != nil { | ||
rcMap["backing_provider_name"] = cty.StringVal(*rc.BackingProviderName) | ||
} | ||
|
@@ -151,59 +150,57 @@ func writeReplicationSpec(cluster *hclwrite.Body, specs []admin.ReplicationSpec2 | |
"disk_gb_enabled": cty.BoolVal(false), | ||
}) | ||
} else { | ||
autoScaling := rc.GetAutoScaling() | ||
asDisk := autoScaling.GetDiskGB() | ||
if autoScaling.Compute != nil { | ||
return fmt.Errorf("auto_scaling.compute is not supported yet %v", autoScaling) | ||
as := rc.GetAutoScaling() | ||
asDisk := as.GetDiskGB() | ||
if as.Compute != nil { | ||
return fmt.Errorf("auto_scaling.compute is not supported yet %v", as) | ||
} | ||
rcMap["auto_scaling"] = cty.ObjectVal(map[string]cty.Value{ | ||
"disk_gb_enabled": cty.BoolVal(asDisk.GetEnabled()), | ||
}) | ||
} | ||
|
||
nodeSpec := rc.GetElectableSpecs() | ||
es := rc.GetElectableSpecs() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these changes related with test workflow changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not exactly, these were to fix one of the tests |
||
esMap := map[string]cty.Value{} | ||
if nodeSpec.InstanceSize != nil { | ||
esMap["instance_size"] = cty.StringVal(*nodeSpec.InstanceSize) | ||
if es.InstanceSize != nil { | ||
esMap["instance_size"] = cty.StringVal(*es.InstanceSize) | ||
} | ||
if nodeSpec.NodeCount != nil { | ||
esMap["node_count"] = cty.NumberIntVal(int64(*nodeSpec.NodeCount)) | ||
if es.NodeCount != nil { | ||
esMap["node_count"] = cty.NumberIntVal(int64(*es.NodeCount)) | ||
} | ||
if nodeSpec.EbsVolumeType != nil && *nodeSpec.EbsVolumeType != "" { | ||
esMap["ebs_volume_type"] = cty.StringVal(*nodeSpec.EbsVolumeType) | ||
if es.EbsVolumeType != nil && *es.EbsVolumeType != "" { | ||
esMap["ebs_volume_type"] = cty.StringVal(*es.EbsVolumeType) | ||
} | ||
if nodeSpec.DiskIOPS != nil { | ||
esMap["disk_iops"] = cty.NumberIntVal(int64(*nodeSpec.DiskIOPS)) | ||
if es.DiskIOPS != nil { | ||
esMap["disk_iops"] = cty.NumberIntVal(int64(*es.DiskIOPS)) | ||
} | ||
if len(esMap) > 0 { | ||
rcMap["electable_specs"] = cty.ObjectVal(esMap) | ||
} | ||
|
||
readOnlySpecs := rc.GetReadOnlySpecs() | ||
if readOnlySpecs.GetNodeCount() != 0 { | ||
roMap := map[string]cty.Value{} | ||
if readOnlySpecs.InstanceSize != nil { | ||
roMap["instance_size"] = cty.StringVal(*readOnlySpecs.InstanceSize) | ||
} | ||
if readOnlySpecs.NodeCount != nil { | ||
roMap["node_count"] = cty.NumberIntVal(int64(*readOnlySpecs.NodeCount)) | ||
} | ||
if readOnlySpecs.DiskIOPS != nil { | ||
roMap["disk_iops"] = cty.NumberIntVal(int64(*readOnlySpecs.DiskIOPS)) | ||
} | ||
if len(roMap) > 0 { | ||
rcMap["read_only_specs"] = cty.ObjectVal(roMap) | ||
} | ||
ros := rc.GetReadOnlySpecs() | ||
roMap := map[string]cty.Value{} | ||
if ros.InstanceSize != nil { | ||
roMap["instance_size"] = cty.StringVal(*ros.InstanceSize) | ||
} | ||
if ros.NodeCount != nil && *ros.NodeCount != 0 { | ||
roMap["node_count"] = cty.NumberIntVal(int64(*ros.NodeCount)) | ||
maastha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
if ros.DiskIOPS != nil { | ||
roMap["disk_iops"] = cty.NumberIntVal(int64(*ros.DiskIOPS)) | ||
} | ||
if len(roMap) > 0 { | ||
rcMap["read_only_specs"] = cty.ObjectVal(roMap) | ||
} | ||
|
||
rcList = append(rcList, cty.ObjectVal(rcMap)) | ||
} | ||
|
||
specMap["region_configs"] = cty.ListVal(rcList) | ||
// Use TupleVal instead of ListVal so region/spec objects can have different fields without type conflicts. | ||
maastha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
specMap["region_configs"] = cty.TupleVal(rcList) | ||
allSpecs = append(allSpecs, cty.ObjectVal(specMap)) | ||
} | ||
|
||
cluster.SetAttributeValue("replication_specs", cty.ListVal(allSpecs)) | ||
cluster.SetAttributeValue("replication_specs", cty.TupleVal(allSpecs)) | ||
return nil | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.