Skip to content

Commit

Permalink
Add namespace and base_image_name fields to Image schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Oct 22, 2024
1 parent f9011c2 commit 92a1f2a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ai/backend/manager/models/gql_models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@

class Image(graphene.ObjectType):
id = graphene.UUID()
name = graphene.String()
name = graphene.String(deprecation_reason="Deprecated since 24.09.1. use `namespace` instead")
namespace = graphene.String(description="Added in 24.09.1.")
base_image_name = graphene.String(description="Added in 24.09.1.")
project = graphene.String(description="Added in 24.03.10.")
humanized_name = graphene.String()
tag = graphene.String()
Expand Down Expand Up @@ -110,6 +112,8 @@ def populate_row(
ret = cls(
id=row.id,
name=row.image,
namespace=row.image,
base_image_name=image_ref.name,
project=row.project,
humanized_name=row.image,
tag=row.tag,
Expand Down Expand Up @@ -320,7 +324,9 @@ class Meta:
interfaces = (AsyncNode,)

row_id = graphene.UUID(description="Added in 24.03.4. The undecoded id value stored in DB.")
name = graphene.String()
name = graphene.String(deprecation_reason="Deprecated since 24.09.1. use `namespace` instead")
namespace = graphene.String(description="Added in 24.09.1.")
base_image_name = graphene.String(description="Added in 24.09.1.")
project = graphene.String(description="Added in 24.03.10.")
humanized_name = graphene.String()
tag = graphene.String()
Expand Down Expand Up @@ -356,6 +362,8 @@ def from_row(cls, row: ImageRow | None) -> ImageNode | None:
id=row.id,
row_id=row.id,
name=row.image,
namespace=row.image,
base_image_name=image_ref.name,
project=row.project,
humanized_name=row.image,
tag=row.tag,
Expand Down Expand Up @@ -385,8 +393,12 @@ def from_legacy_image(cls, row: Image) -> ImageNode:
id=row.id,
row_id=row.id,
name=row.name,
namespace=row.namespace,
base_image_name=row.base_image_name,
humanized_name=row.humanized_name,
tag=row.tag,
tags=row.tags,
version=row.version,
project=row.project,
registry=row.registry,
architecture=row.architecture,
Expand Down

0 comments on commit 92a1f2a

Please sign in to comment.