Skip to content

Commit be72ced

Browse files
authored
validate max price in spot instance request (#1198)
Signed-off-by: Moath Qasim <[email protected]>
1 parent 2b93e00 commit be72ced

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cloudprovider/provider/aws/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,12 @@ func (p *provider) Validate(spec clusterv1alpha1.MachineSpec) error {
633633
return fmt.Errorf("failed to validate instance profile: %v", err)
634634
}
635635

636+
if config.IsSpotInstance != nil && *config.IsSpotInstance {
637+
if config.SpotMaxPrice == nil {
638+
return errors.New("failed to validate max price for the spot instance: max price cannot be empty when spot instance ")
639+
}
640+
}
641+
636642
return nil
637643
}
638644

0 commit comments

Comments
 (0)