Merge "Enable pod update using pod_defintion_url"

This commit is contained in:
Jenkins 2015-01-01 23:49:38 +00:00 committed by Gerrit Code Review
commit a44474a2d7
1 changed files with 7 additions and 1 deletions

View File

@ -140,7 +140,13 @@ class KubeClient(object):
def pod_update(contents):
LOG.debug("pod_update contents %s" % contents)
try:
out, err = utils.trycmd('kubectl', 'update', '-f', contents)
if contents.pod_definition_url:
out, err = utils.trycmd('kubectl', 'update', '-f',
contents.pod_definition_url)
else:
# TODO(jay-lau-513) Translate the contents to a json stdin
out, err = utils.trycmd('echo contents | kubectl', 'update',
'-f', '-')
if err:
return False
except Exception as e: