Autoscaler is using an invalid digital ocean image

I’m configuring the autoscaler with Digital Ocean. I’m getting the following error:

2019-02-20T12:48:40Z |ERRO| cannot create instance error=“POST https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.” id=HxHZXzMLR03eUj25 image=docker-16-04 name=agent-9gyr9yxS region=nyc1 size=s-2vcpu-4gb

It seems that “docker-16-04” is no longer a valid image. The autoscaler should probably use “docker-18-04” instead.

You can set image with DROEN_DIGITAL_OCEAN environment variable. If you would like to update the default image, we would appreciate a pull request to github.com/drone/autoscaler. Thanks!

I’ve tried the DRONE_DIGITALOCEAN_IMAGE environment variable, but the autoscaler still use the default image.

I could not find the variable that overrides the image at https://autoscale.drone.io/reference/. Is its support missing?

the field is here: https://github.com/drone/autoscaler/blob/master/config/config.go#L94

see the following unit test which demonstrates how it works: https://github.com/drone/autoscaler/blob/master/config/load_test.go#L82

I can confirm that the environment variable is properly set. Running the following command:

docker exec DroneAutoscaler sh -c 'echo $DRONE_DIGITALOCEAN_IMAGE'

Give the result:

docker-18-04

But still, the default image (docker-16-04) is used.

I’ve created a pull request to fix this issue :slight_smile:

Thank you so much! I have merged both pull requests