Switch back to using git for the agent ref

A diskimage-builder patch [1] broke our amphora-agent element by
uninstalling git prior to the post-install.d phase.
A followup patch in Octavia [2] changed how we get the git
reference to awking an git internal log file. This seems fragile
to me, so I am proposing this alternative.
This patch updates our element to finish using git before the
install.d phase is complete.

[1] https://review.opendev.org/745678
[2] https://review.opendev.org/745683

Change-Id: I9a346b626f852171ec00d2868ccb6f98b1fb8994
This commit is contained in:
Michael Johnson 2020-08-18 11:09:30 -07:00
parent 1d1142a13d
commit 7d6322ae08
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,9 @@ $AMP_VENV/bin/pip install pip --upgrade
$AMP_VENV/bin/pip install -U -c /opt/upper-constraints.txt /opt/amphora-agent
# Let's capture the git reference we installed in the venv
git --git-dir=/opt/amphora-agent/.git rev-parse HEAD >> /opt/amphora-agent.gitref
# Workaround https://github.com/svinota/pyroute2/issues/724
# TODO(johnsom) Remove once a that is resolved and 0.5.13 has been blocked in
# global requirements.

View File

@ -9,7 +9,6 @@ set -o pipefail
[ "${DIB_INSTALLTYPE_amphora_agent:-}" = "package" ] && exit 0
awk 'FNR == 1 {print $1}' /opt/amphora-agent/.git/logs/HEAD >> /opt/amphora-agent.gitref
rm -rf /opt/amphora-agent
case $DISTRO_NAME in