cros_sdk: Proxies goma_dir and goma_client_json to enter_chroot.

Now enter_chroot is supporting goma.
With this CL, cros_sdk proxies those flags to enter_chroot.sh.

CQ-DEPEND=CL:448479
BUG=chromium:279618
TEST=Ran "cros_sdk --goma_dir $GOMA", then goma_ctl.py restart works.
     Ran "cros_sdk --goma_client_json $JSON_FILE".

Change-Id: I82b75a3093330b3e6e5b0286aa12453a6cacf531
Reviewed-on: https://chromium-review.googlesource.com/448344
Commit-Ready: Hidehiko Abe <hidehiko@chromium.org>
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index f813cf1..0d8eb80 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -217,7 +217,7 @@
 
 
 def EnterChroot(chroot_path, cache_dir, chrome_root, chrome_root_mount,
-                workspace, additional_args):
+                workspace, goma_dir, goma_client_json, additional_args):
   """Enters an existing SDK chroot"""
   st = os.statvfs(os.path.join(chroot_path, 'usr', 'bin', 'sudo'))
   # The os.ST_NOSUID constant wasn't added until python-3.2.
@@ -231,6 +231,10 @@
     cmd.extend(['--chrome_root_mount', chrome_root_mount])
   if workspace:
     cmd.extend(['--workspace_root', workspace])
+  if goma_dir:
+    cmd.extend(['--goma_dir', goma_dir])
+  if goma_client_json:
+    cmd.extend(['--goma_client_json', goma_client_json])
 
   if len(additional_args) > 0:
     cmd.append('--')
@@ -495,6 +499,11 @@
                             % (sdk_latest_version, bootstrap_latest_version)))
   parser.add_argument('--workspace',
                       help='Workspace directory to mount into the chroot.')
+  parser.add_argument('--goma_dir', type='path',
+                      help='Goma installed directory to mount into the chroot.')
+  parser.add_argument('--goma_client_json', type='path',
+                      help='Service account json file to use goma on bot. '
+                           'Mounted into the chroot.')
   parser.add_argument('commands', nargs=argparse.REMAINDER)
 
   # SDK overlay tarball options (mutually exclusive).
@@ -714,4 +723,5 @@
         lock.read_lock()
         EnterChroot(options.chroot, options.cache_dir, options.chrome_root,
                     options.chrome_root_mount, options.workspace,
+                    options.goma_dir, options.goma_client_json,
                     chroot_command)