psi-4ward / docker-powerdns

PowerDNS Docker Image based on Alpine
107 stars 110 forks source link

Entrypoint optimizations #4

Closed tcely closed 6 years ago

psi-4ward commented 7 years ago

Can you explain the advantages of your changes?

tcely commented 7 years ago

The main thrust here is argument safety. Try using a password with a space in it with your original version for instance.

The secondary objective was to run the sed program once instead of multiple times. This allows for using the backup function more easily and is going to be quicker too.

psi-4ward commented 7 years ago

I see no reason why a password with whitespaces shouldn't work. And you also run sed multiple times inside of the for loop.

For me, your versions adds some complexity but a good thing would be optional mysql if we include other backends.

tcely commented 7 years ago

That for loop isn't running sed, it's generating the program that sed runs after the loop.

tcely commented 6 years ago

I see no changes regarding the optimizations.