root: fix build_hash being set incorrectly for tagged versions

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-13 13:32:18 +02:00
parent 8c0c12292e
commit ddfc943bba
1 changed files with 5 additions and 1 deletions

View File

@ -375,7 +375,11 @@ if _ERROR_REPORTING:
environment=CONFIG.y("error_reporting.environment", "customer"), environment=CONFIG.y("error_reporting.environment", "customer"),
send_default_pii=CONFIG.y_bool("error_reporting.send_pii", False), send_default_pii=CONFIG.y_bool("error_reporting.send_pii", False),
) )
set_tag("authentik.build_hash", os.environ.get(ENV_GIT_HASH_KEY, "tagged")) # Default to empty string as that is what docker has
build_hash = os.environ.get(ENV_GIT_HASH_KEY, "")
if build_hash == "":
build_hash = "tagged"
set_tag("authentik.build_hash", build_hash)
set_tag( set_tag(
"authentik.env", "kubernetes" if "KUBERNETES_PORT" in os.environ else "compose" "authentik.env", "kubernetes" if "KUBERNETES_PORT" in os.environ else "compose"
) )