Giter Club home page Giter Club logo

Comments (3)

JonasProgrammer avatar JonasProgrammer commented on May 29, 2024

Hi,

the driver attempts to create a remote key corresponding with the local public key. Apparently, hetzner disallows the creation of keys with the same fingerprint; I did not know this until now, perhaps this is worth mentioning in the README.

As a workaround, I'd suggest creating the public key manually and refer to it using --hetzner-existing-key-id.

Of course, we could simply add a heuristic searching for an existing key by fingerprint, if --hetzner-existing-key-path is passed, but IMHO this will create issues downstream. When not passed --hetzner-existing-key-id. the driver attempts to also destroy the key on machine destruction.
Now suppose we had this heuristic, someone could create machine-a, thereby creating a managed key k. Then machine-b is created and uses the existing k in unmanaged mode, as it is found by fingerprint. Attempting to destroy machine-a now will not work anymore, as it will be unable to delete k.

I don't have a good solution for this problem right now, but the workaround of passing the ID should get you up and running for now.

from docker-machine-driver-hetzner.

am97 avatar am97 commented on May 29, 2024

Thanks for your answer !

I implemented the search for an existing key by fingerprint, then created successfully 2 machines. Attempting to destroy machine-a works (the key is deleted from Hetzner, even if it's still used by machine-b). Destroying machine-b also works !

I only changed the Create() function, I will open a WIP pull request so you can see my changes

from docker-machine-driver-hetzner.

JonasProgrammer avatar JonasProgrammer commented on May 29, 2024

Thank you very much for investigating this further; apparently there was some confusion on my side. While I'm positive I've faced some referential integrity issues in the past, either Hetzner changed something or -- most likely -- I got things mixed up. Nonetheless, thank you for pushing for a solution despite my negative and, as it turns out, wrong answer.

Your PR looks good in general, but I've added a few comments. You can try and resolve them yourself; don't hesitate to let me know if you need help or want me to make the requested changes.

from docker-machine-driver-hetzner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.