[binami/etcd] If container is run as root, only chown etcd.yaml config file if it exists. (#72249)

Signed-off-by: Ryan Koski <Ryan.Koski@target.com>
This commit is contained in:
Ryan Koski
2024-09-11 11:40:46 -04:00
committed by GitHub
parent c20b8220a0
commit 31fe2f197a
2 changed files with 2 additions and 2 deletions

View File

@@ -100,7 +100,7 @@ etcd_setup_from_environment_variables() {
fi
fi
done
if am_i_root; then
if am_i_root && [[ -f "$ETCD_CONF_FILE" ]] ; then
chown "$ETCD_DAEMON_USER" "$ETCD_CONF_FILE"
fi
}

View File

@@ -100,7 +100,7 @@ etcd_setup_from_environment_variables() {
fi
fi
done
if am_i_root; then
if am_i_root && [[ -f "$ETCD_CONF_FILE" ]] ; then
chown "$ETCD_DAEMON_USER" "$ETCD_CONF_FILE"
fi
}