gcloud: Fallback zone support (WIP)#4536
gcloud: Fallback zone support (WIP)#4536angelcerveraroldan wants to merge 2 commits intocoreos:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to discover available GCP zones within a region for a specific machine type, intended to support fallback when resources are depleted. It updates the API struct to store a list of available zones and modifies the kola CLI help text to reflect this new behavior. Review feedback notes that while the zones are now discovered and stored, they are not yet utilized in the instance creation logic. Additionally, it is recommended to move the regular expression compilation for zone parsing to the package level to improve performance during zone discovery.
08b15ad to
d8b370d
Compare
|
/test all |
prestist
left a comment
There was a problem hiding this comment.
This is looking really good :) I know its wip but here are some quick reviews!
| } | ||
|
|
||
| zones := []string{} | ||
| for _, scopedList := range list.Items { |
There was a problem hiding this comment.
Fun fact, go maps do not specifically iterate in order. So in a way this is kinda a cool outcome due to load spreading across the list of zones. Though if we want order we could sort it after collection of zones.
| return nil, err | ||
| } | ||
| plog.Debugf("Creating instance %q in zone %s", name, zone) | ||
| op, err := a.compute.Instances.Insert(a.options.Project, zone, inst).Do() |
There was a problem hiding this comment.
hmmm, this has potential to leave old bits still opened; I dont know how good garbage collection is but if we fail we should probably should terminate failed instances?
0b9e497 to
215d06c
Compare
abe7397 to
94b708d
Compare
When we fail to connect to a machine with an error that indicates that the zone we are connecting to is not functioning correctly, fallback to a different zone and try again.
94b708d to
72a6bcc
Compare
We seem to be hitting a lot of zone issues with GCP. It may be worth allowing the zones to change automatically when there are errors, so that we dont have to keep manually changing the zone in the pipeline.
Note: This is not yet tested / finished.