19320: Use AWS spot price data to calculate container cost.
[arvados.git] / lib / cloud / loopback / loopback.go
index 9b71c9f162b9083731f5e3113755fefdae0c31a5..ed2a0050f4f33a07a0b9a25fbdcc8e911547d0d9 100644 (file)
@@ -64,7 +64,9 @@ func (is *instanceSet) Create(it arvados.InstanceType, _ cloud.ImageID, tags clo
        // destroy+create cycle doesn't fix whatever was broken -- but
        // nothing else will either, so the best we can do is remove
        // the "broken" flag and try again.
-       if err := os.Remove("/var/lock/crunch-run-broken"); err != nil && !errors.Is(err, os.ErrNotExist) {
+       if err := os.Remove("/var/lock/crunch-run-broken"); err == nil {
+               is.logger.Info("removed /var/lock/crunch-run-broken")
+       } else if !errors.Is(err, os.ErrNotExist) {
                return nil, err
        }
        u, err := user.Current()
@@ -128,12 +130,13 @@ type instance struct {
        sshService   test.SSHService
 }
 
-func (i *instance) ID() cloud.InstanceID     { return cloud.InstanceID(i.instanceType.ProviderType) }
-func (i *instance) String() string           { return i.instanceType.ProviderType }
-func (i *instance) ProviderType() string     { return i.instanceType.ProviderType }
-func (i *instance) Address() string          { return i.sshService.Address() }
-func (i *instance) RemoteUser() string       { return i.adminUser }
-func (i *instance) Tags() cloud.InstanceTags { return i.tags }
+func (i *instance) ID() cloud.InstanceID                { return cloud.InstanceID(i.instanceType.ProviderType) }
+func (i *instance) String() string                      { return i.instanceType.ProviderType }
+func (i *instance) ProviderType() string                { return i.instanceType.ProviderType }
+func (i *instance) Address() string                     { return i.sshService.Address() }
+func (i *instance) PriceHistory() []cloud.InstancePrice { return nil }
+func (i *instance) RemoteUser() string                  { return i.adminUser }
+func (i *instance) Tags() cloud.InstanceTags            { return i.tags }
 func (i *instance) SetTags(tags cloud.InstanceTags) error {
        i.tags = tags
        return nil