Change owner of the secret file in prepare script

The secretkey file will be loaded by adminserver which is run by non-root
user (uid:10000) previously the entrypoint script will run `chown` to a
lot files, and there's a breakage in upgrade when we skip running
`chown` inside container.
This commit will fix the issue during upgrade by changing the owner of
the secretkey file.
This commit is contained in:
Daniel Jiang 2018-06-08 16:13:37 +08:00
parent 7254b438ca
commit ccbd23d14e
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ def _get_secret(folder, filename, length=16):
with open(key_file, 'r') as f:
key = f.read()
print("loaded secret from file: %s" % key_file)
mark_file(key_file)
return key
if not os.path.isdir(folder):
os.makedirs(folder)