Commit 5c9a00fd authored by kalvin's avatar kalvin

环境变量

parent 0bb44c84
......@@ -6,4 +6,6 @@ COPY run.py .
RUN pip install requests
RUN chmod +x ./run.py
RUN export NAMESPACE=`cat /var/run/secrets/kubernetes.io/serviceaccount/namespace`
CMD ["python", "-c", "run.py"]
\ No newline at end of file
......@@ -5,7 +5,7 @@ import json
def check():
url = "http://192.168.29.116:9001/api/etcd/get_env_job_status"
querystring = {"namespace":"0zhangbo"}
querystring = {"namespace": os.getenv('NAMESPACE')}
headers = {}
response = requests.request("GET", url, headers=headers, params=querystring)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment