Skip to content

Commit 1524a3e

Browse files
committed
Fix: Access to PersistentVolumeSizeMib is incompatible after migrating to Pydantic2
Using model_validate to access it
1 parent dd80a66 commit 1524a3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/aleph/sdk/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from uuid import UUID
2929
from zipfile import BadZipFile, ZipFile
3030

31+
import pydantic_core
3132
from aleph_message.models import (
3233
Chain,
3334
InstanceContent,
@@ -504,7 +505,9 @@ def make_instance_content(
504505
ref=ItemHash(rootfs),
505506
use_latest=True,
506507
),
507-
size_mib=PersistentVolumeSizeMib(rootfs_size),
508+
size_mib=PersistentVolumeSizeMib.model_validate(
509+
{"size_mib": rootfs_size}
510+
).size_mib,
508511
persistence=VolumePersistence.host,
509512
),
510513
volumes=[parse_volume(volume) for volume in volumes],

0 commit comments

Comments
 (0)