prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  versioned caching is broken
  On [this line](https://github.com/ocf/ocfweb/blob/e0ca5b9053abf4908fd6dd3ff344724e61c38b53/ocfweb/environment.py#L15) we use a marathon environment variable to determine the cache version. We need to change this to use a Kubernetes things, a la 
  https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/.
  
  </issue>
  <code>
  [start of ocfweb/environment.py]
  1 """Introspection into the current environment."""
  2 import os
  3 from functools import lru_cache
  4 
  5 
  6 @lru_cache()
  7 def ocfweb_version():
  8     """Return string representing ocfweb version.
  9 
  10     In dev, returns 'dev'. In prod, returns a version
  11     similar to '2015.12.06.02.25-gitb98c8cb6'.
  12     """
  13     # On Marathon, read it out of environ
  14     try:
  15         docker_image, tag = os.environ['MARATHON_APP_DOCKER_IMAGE'].split(':', 1)
  16         return tag
  17     except KeyError:
  18         pass
  19 
  20     # Otherwise, we must be in dev.
  21     return 'dev'
  22
  [end of ocfweb/environment.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/ocfweb/environment.py b/ocfweb/environment.py
  --- a/ocfweb/environment.py
  +++ b/ocfweb/environment.py
  @@ -8,12 +8,11 @@
       """Return string representing ocfweb version.
   
       In dev, returns 'dev'. In prod, returns a version
  -    similar to '2015.12.06.02.25-gitb98c8cb6'.
  +    similar to '2019-08-20-T21-10-57-gite0ca5b9'.
       """
  -    # On Marathon, read it out of environ
  +    # On Kubernetes, read it out of environ
       try:
  -        docker_image, tag = os.environ['MARATHON_APP_DOCKER_IMAGE'].split(':', 1)
  -        return tag
  +        return os.environ['OCFWEB_PROD_VERSION']
       except KeyError:
           pass
  
verification_info: {"golden_diff": "diff --git a/ocfweb/environment.py b/ocfweb/environment.py\n--- a/ocfweb/environment.py\n+++ b/ocfweb/environment.py\n@@ -8,12 +8,11 @@\n     \"\"\"Return string representing ocfweb version.\n \n     In dev, returns 'dev'. In prod, returns a version\n-    similar to '2015.12.06.02.25-gitb98c8cb6'.\n+    similar to '2019-08-20-T21-10-57-gite0ca5b9'.\n     \"\"\"\n-    # On Marathon, read it out of environ\n+    # On Kubernetes, read it out of environ\n     try:\n-        docker_image, tag = os.environ['MARATHON_APP_DOCKER_IMAGE'].split(':', 1)\n-        return tag\n+        return os.environ['OCFWEB_PROD_VERSION']\n     except KeyError:\n         pass\n", "issue": "versioned caching is broken\nOn [this line](https://github.com/ocf/ocfweb/blob/e0ca5b9053abf4908fd6dd3ff344724e61c38b53/ocfweb/environment.py#L15) we use a marathon environment variable to determine the cache version. We need to change this to use a Kubernetes things, a la \r\nhttps://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/.\n", "before_files": [{"content": "\"\"\"Introspection into the current environment.\"\"\"\nimport os\nfrom functools import lru_cache\n\n\n@lru_cache()\ndef ocfweb_version():\n    \"\"\"Return string representing ocfweb version.\n\n    In dev, returns 'dev'. In prod, returns a version\n    similar to '2015.12.06.02.25-gitb98c8cb6'.\n    \"\"\"\n    # On Marathon, read it out of environ\n    try:\n        docker_image, tag = os.environ['MARATHON_APP_DOCKER_IMAGE'].split(':', 1)\n        return tag\n    except KeyError:\n        pass\n\n    # Otherwise, we must be in dev.\n    return 'dev'\n", "path": "ocfweb/environment.py"}]}