Enable pod update using pod_defintion_url

Change-Id: I6d24d144e33898b8b2038034ca3f7cb44dc54e9d
This commit is contained in:
Jay Lau (Guangya Liu) 2014-12-31 07:07:11 -05:00
parent 01e4d151e6
commit bac58ab49b
1 changed files with 7 additions and 1 deletions

View File

@ -115,7 +115,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: