Skip to content

Commit 218bfc8

Browse files
authored
Update indexer. (#13436)
1 parent 675ebda commit 218bfc8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

infra/base-images/base-builder/indexer/manifest_types.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ def from_dict(cls, config_dict: Mapping[Any, Any]) -> Self:
179179
val = dict(val, binary_args=shlex.split(val["binary_args"]))
180180
return mapping[kind].from_dict(val)
181181

182+
def to_dict(self) -> Mapping[Any, Any]:
183+
"""Converts a BinaryConfig object to a serializable dict."""
184+
return dataclasses.asdict(self)
185+
182186

183187
@dataclasses.dataclass(frozen=True, kw_only=True)
184188
class CommandLineBinaryConfig(BinaryConfig):
@@ -282,13 +286,11 @@ def to_dict(self) -> dict[str, Any]:
282286
"""Converts a Manifest object to a serializable dict."""
283287
data = dataclasses.asdict(self)
284288

285-
patches = data["binary_config"].get("patches")
286-
if patches:
287-
patches[:] = [path.as_posix() for path in patches]
288-
289+
data["binary_config"] = self.binary_config.to_dict()
289290
data["lib_mount_path"] = _get_mapped(data, "lib_mount_path",
290291
lambda x: x.as_posix())
291292
data["source_map"] = _get_mapped(data, "source_map", source_map_to_dict)
293+
292294
return data
293295

294296
def validate(self) -> None:

0 commit comments

Comments
 (0)