ucphhpc / docker-migrid

Containerized MiG
GNU General Public License v2.0
3 stars 7 forks source link

Makefile: rollback of removing certs in clean target #37

Closed benibr closed 9 months ago

benibr commented 9 months ago

This PR rolles back the change of removing certs in the clean target as wished by @Bjarke42

benibr commented 9 months ago

@Bjarke42 please check if https://github.com/ucphhpc/ansible-docker-migrid/pull/22 would be alternative to this.

Either way testing this PR before merging is necessary cause I only checks briefly if it works.

jonasbardino commented 9 months ago

I don't mind merging as a temporary workaround if urgent, but I don't have time to test anything right now. So it would probably be better to go with that ansible-docker-migrid PR 22, or do whatever it takes to implement support for having your certs in a symlinked directory there so that it just works with the latest docker-migrid release.

Bjarke42 commented 9 months ago

I'am in a situation where i don't know what is best. If we make it in ansible-docker-migrid then we also loose the ability to do a make clean and make again as we sometimes do. If this is to be supported by ansible, it will just have to build more technical stuff to support this work around in ansible for a very simple solution by makeing "make clean" only concerning make. And not tampering with other stuff.

jonasbardino commented 9 months ago

The point is that by default make init actually does create that certs dir and make dockerbuild then inhabits it with self-signed certificates. So it makes perfectly sense that make clean removes it. It is only because you put a custom certificates dir in that same location you run into trouble with clean now. Admittedly, we do something similar just with a symlink and therefore had to do a bit of extra work with the added symlink check in clean. Unfortunately we cannot as easily detect if a given certs directory is the generated one or your custom replacement from inside make clean.

jonasbardino commented 9 months ago

If you can put a magic file marker (.persistent) inside your custom certs dir, we could add a similar bail-out for make clean when it is found:

        [ -L ./certs ] || [ -f ./certs/.persistent ] || rm -fr ./certs

Would that work for you?

Bjarke42 commented 9 months ago

Thanks for all the good and nice arguments :) We will close this one and implement it in Ansible-docker-migrid. So i have decided on what @benibr said in a chat comment. So please close this PR.