diff --git a/src/bentoml/_internal/cloud/deployment.py b/src/bentoml/_internal/cloud/deployment.py index 6beb7738e72..2728c2afbeb 100644 --- a/src/bentoml/_internal/cloud/deployment.py +++ b/src/bentoml/_internal/cloud/deployment.py @@ -742,9 +742,12 @@ def _generate_deployment_info_( context: str | None, res: DeploymentSchema, urls: list[str] | None = None ) -> DeploymentInfo: client = get_rest_api_client(context) + admin_console = f"{client.v1.endpoint}/deployments/{res.name}" + if res.cluster.is_first is False: + admin_console = f"{client.v1.endpoint}/deployments/{res.name}?cluster={res.cluster.name}&namespace={res.kube_namespace}" return DeploymentInfo( name=res.name, - admin_console=f"{client.v1.endpoint}/deployments/{res.name}?cluster={res.cluster.name}&namespace={res.kube_namespace}", + admin_console=admin_console, created_at=res.created_at.strftime("%Y-%m-%d %H:%M:%S"), created_by=res.creator.name, cluster=res.cluster.name, diff --git a/src/bentoml/_internal/cloud/schemas/schemasv1.py b/src/bentoml/_internal/cloud/schemas/schemasv1.py index 0de5e56857d..2b4819873c9 100644 --- a/src/bentoml/_internal/cloud/schemas/schemasv1.py +++ b/src/bentoml/_internal/cloud/schemas/schemasv1.py @@ -64,6 +64,7 @@ class ClusterSchema(ResourceSchema): description: str organization_name: str creator: UserSchema + is_first: t.Optional[bool] = None @attr.define @@ -279,7 +280,7 @@ class ResourceInstanceSchema(ResourceSchema): config: ResourceInstanceConfigSchema -@attr.define +@attr.define(kw_only=True) class ClusterFullSchema(ClusterSchema): __omit_if_default__ = True __forbid_extra_keys__ = False