chromite: support --channels in PushImage BAPI endpoint
BUG=b:202716782
TEST=run_tests
Change-Id: I8421ed8ff977b6b7097e359dd319cfb932a1b0e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3217507
Reviewed-by: George Engelbrecht <engeg@google.com>
Tested-by: George Engelbrecht <engeg@google.com>
Commit-Queue: Jack Neus <jackneus@google.com>
diff --git a/api/controller/image.py b/api/controller/image.py
index 7a42a56..a0609ac 100644
--- a/api/controller/image.py
+++ b/api/controller/image.py
@@ -164,7 +164,7 @@
base_path = chroot.full_path(sysroot_class.path)
board = build_target.name
factory_shim_location = Path(
- image_lib.GetLatestImageLink(board, pointer=LOCATION_FACTORY)).resolve()
+ image_lib.GetLatestImageLink(board, pointer=LOCATION_FACTORY)).resolve()
generated = []
dlc_func = functools.partial(image.copy_dlc_image, base_path)
@@ -458,6 +458,11 @@
kwargs['profile'] = input_proto.profile.name
if input_proto.dest_bucket:
kwargs['dest_bucket'] = input_proto.dest_bucket
+ if input_proto.channels:
+ kwargs['force_channels'] = [
+ common_pb2.Channel.Name(channel).lower()[len('channel_'):]
+ for channel in input_proto.channels
+ ]
try:
pushimage.PushImage(
input_proto.gs_image_dir,