Skip to content

Commit

Permalink
Add kubernetes runtime environment check in usage logging
Browse files Browse the repository at this point in the history
Signed-off-by: Niels Nuyttens <niels@nannyml.com>
  • Loading branch information
nnansters committed Jul 3, 2023
1 parent 5560a10 commit e400726
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nannyml/usage_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ def _is_running_in_docker():
return False


def is_running_in_kubernetes():
return Path('/var/run/secrets/kubernetes.io/').exists()


# Inspired by
# https://github.com/zenml-io/zenml/blob/275109da08b783d5d2cd508b5f703aed0c66e485/src/zenml/environment.py#L182
# and https://stackoverflow.com/a/39662359
Expand Down

0 comments on commit e400726

Please sign in to comment.