feat(spot): Setting the VNG Size Limits in Launch Spec

This commit is contained in:
idanshoham 2023-03-19 10:30:34 +02:00 committed by GitHub
parent f7fe2bc155
commit 222e138683
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -546,13 +546,16 @@ func (b *SpotInstanceGroupModelBuilder) buildLaunchSpec(c *fi.CloudupModelBuilde
// Capacity.
minSize, maxSize := b.buildCapacity(ig)
if fi.ValueOf(ocean.UseAsTemplateOnly) {
launchSpec.MinSize = minSize
launchSpec.MaxSize = maxSize
ocean.MinSize = minSize
ocean.MaxSize = maxSize
} else {
ocean.MinSize = fi.PtrTo(fi.ValueOf(ocean.MinSize) + fi.ValueOf(minSize))
ocean.MaxSize = fi.PtrTo(fi.ValueOf(ocean.MaxSize) + fi.ValueOf(maxSize))
}
launchSpec.MinSize = minSize
launchSpec.MaxSize = maxSize
// User data.
if ig.Name == igOcean.Name && !featureflag.SpotinstOceanTemplate.Enabled() {
launchSpec.UserData = ocean.UserData