19320: Comment re future use of spot attr in priceKey.
authorTom Clegg <tom@curii.com>
Tue, 24 Jan 2023 22:44:27 +0000 (17:44 -0500)
committerTom Clegg <tom@curii.com>
Tue, 24 Jan 2023 22:47:31 +0000 (17:47 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/cloud/ec2/ec2.go

index 7c7c48b9b3dfb28ddec41a3faf3ec24f58bbef66..a4f6b2da7c1f627c9d215713f1d0851dc8f10e9b 100644 (file)
@@ -506,6 +506,9 @@ func (inst *ec2Instance) VerifyHostKey(ssh.PublicKey, *ssh.Client) error {
 func (inst *ec2Instance) PriceHistory(instType arvados.InstanceType) []cloud.InstancePrice {
        inst.provider.pricesLock.Lock()
        defer inst.provider.pricesLock.Unlock()
+       // Note updateSpotPrices currently populates
+       // inst.provider.prices only for spot instances, so if
+       // spot==false here, we will return no data.
        pk := priceKey{
                instanceType:     *inst.instance.InstanceType,
                spot:             aws.StringValue(inst.instance.InstanceLifecycle) == "spot",