JonasProgrammer / docker-machine-driver-hetzner

Docker machine driver for the new hetzner cloud API
https://jonasprogrammer.github.io/docker-machine-driver-hetzner/
MIT License
426 stars 53 forks source link

OS-image list paging #124

Open smirnov-mi opened 1 month ago

smirnov-mi commented 1 month ago

Hi @JonasProgrammer I wasn’t able to set the OS to ubuntu-24.04 in the node driver, and did a little research. It looks like the driver listening of the images should be updated as following:

Our API implements pagination as mentioned in our docs at: https://docs.hetzner.cloud/#pagination

You can see the full list of images by specifying either the page or the number of results. For example: curl -H "Authorization: Bearer $HCLOUD_TOKEN" "https://api.hetzner.cloud/v1/images?per_page=50"

that’s what hetzner support replied to my question.

JonasProgrammer commented 1 month ago

Hi @smirnov-mi

The driver does not list images or keep a list of hardcoded images somewhere. It actually resolves the image as given by the image.Get interface, which uses a heuristic to determine whether it should search by ID or name.

docker-machine --debug create -d hetzner --hetzner-server-location hel1 --hetzner-image ubuntu-24.04 foo works perfectly fine for me, at least past the point where the image is resolved (PreCreateCheck). Do you have more concrete information on what went wrong on your end?

smirnov-mi commented 1 month ago

So the problem is: I can not see ubuntu 24.04 while selecting the Image in the Node Template. I guess this list is being generated by the UI-driver: https://storage.googleapis.com/hcloud-rancher-v2-ui-driver/component.js Now I'm not sure this is also a part of this repository.

JonasProgrammer commented 1 month ago

Ah, I see. Please note, while the the Rancher driver uses this repository as an implementation detail (IIRC rancher supports the docker-machine interface with some config UI to make a node provider), they are different projects.

The rancher plugin's developer has made many contributions here, but still they are different projects. The problem is, to this day I have never used rancher. While I would like to help out, the last time I checked getting rancher up and and building the plugin seemed like quite a bit of a hassle.

smirnov-mi commented 1 month ago

Oh I see. Do you have contacts of the guys supporting the UI driver?

smirnov-mi commented 1 month ago

I found someone who looks like the maintainer of that UI driver: https://github.com/mxschmitt/ui-driver-hetzner/blob/master/component/component.js There's already a fix in the file, I'm trying to figure out how to get the updated version online so I can use it.