api: sdk: Plumb full chroot proto handling
Most endpoints use controller_util.ParseChroot() to parse chroot
messages and pass that down into their backing service; sdk.Create()
does not, which means we drop the out_path along the way.
Plumb a chroot_lib.Chroot() into service.sdk.CreateArguments(), and use
that.
BUG=b:265885353
TEST=./run_tests
Change-Id: I9b52facc6ac4c599798ff11a445257dcf36ba16e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4497086
Commit-Queue: Brian Norris <briannorris@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
diff --git a/api/controller/sdk.py b/api/controller/sdk.py
index d4c2ace..db57592 100644
--- a/api/controller/sdk.py
+++ b/api/controller/sdk.py
@@ -106,23 +106,18 @@
"""
replace = not input_proto.flags.no_replace
bootstrap = input_proto.flags.bootstrap
+ chroot = controller_util.ParseChroot(input_proto.chroot)
- chroot_path = input_proto.chroot.path
- cache_dir = input_proto.chroot.cache_dir
sdk_version = input_proto.sdk_version
skip_chroot_upgrade = input_proto.skip_chroot_upgrade
- if chroot_path and not os.path.isabs(chroot_path):
- cros_build_lib.Die("The chroot path must be absolute.")
-
if config.validate_only:
return controller.RETURN_CODE_VALID_INPUT
args = sdk.CreateArguments(
replace=replace,
bootstrap=bootstrap,
- cache_dir=cache_dir,
- chroot_path=chroot_path,
+ chroot=chroot,
sdk_version=sdk_version,
skip_chroot_upgrade=skip_chroot_upgrade,
)