UST-MICO / mico

A Management System for Microservice Compositions
Apache License 2.0
8 stars 3 forks source link

mico-admin entrypoint: avoid truncating nginx.conf #876

Closed s1mn closed 4 years ago

s1mn commented 4 years ago

Description

Rather than trying to operate on the nginx.conf file in place (see below on why this fails), this PR changes the docker entrypoint to create a temporary file and then replace nginx.conf with that one.

There are no breaking changes in this PR.

Resolves / is related to

Currently, the mico-admin docker entrypoint reads and writes the nginx.conf in the same shell command. This is a race condition that often leads to erasing the contents of the nginx.conf, because

The shellcheck wiki has an article about this class of problems: https://github.com/koalaman/shellcheck/wiki/SC2094

What is affected by this PR

Checklist