Browse Source

[Tools] gsce: Use the last portion of the parsed app_name

A canonical image repo looks like "foo.com/hello-world:0.1". Thus the parsed
app_name should be the last portion of this string ("hello-world:0.1").
Jia Zhang 4 years ago
parent
commit
16ad03a94e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Tools/gsce

+ 1 - 1
Tools/gsce

@@ -101,7 +101,7 @@ if __name__ == '__main__':
     app_name = image_match.group(1)
 
   # application name may contain '/', remove it
-  app_name = app_name.split('/')[0]
+  app_name = app_name.split('/')[-1]
 
   inspect_cmd = 'sudo docker inspect --format \'{{.Config.Cmd}}\' ' + image_name
   res = subprocess.check_output(inspect_cmd, shell=True).strip()