Skip to content

Commit 7d804ae

Browse files
committed
drop per-app resource class patch; sync from launcher on resume
1 parent 407fd0f commit 7d804ae

4 files changed

Lines changed: 4 additions & 9 deletions

File tree

components/renku_data_services/renku_apps/api.spec.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ components:
186186
properties:
187187
state:
188188
$ref: "#/components/schemas/AppState"
189-
resource_class_id:
190-
type: integer
191189

192190
ErrorResponse:
193191
type: object

components/renku_data_services/renku_apps/apispec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: api.spec.yaml
3-
# timestamp: 2026-06-08T12:56:33+00:00
3+
# timestamp: 2026-06-29T08:41:01+00:00
44

55
from __future__ import annotations
66

@@ -68,7 +68,6 @@ class AppPostRequest(BaseAPISpec):
6868

6969
class AppPatchRequest(BaseAPISpec):
7070
state: Optional[AppState] = None
71-
resource_class_id: Optional[int] = None
7271

7372

7473
class Error(BaseAPISpec):

components/renku_data_services/renku_apps/blueprints.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ async def _patch_one(
8383
user=user,
8484
app_name=app_name,
8585
state=body.state,
86-
resource_class_id=body.resource_class_id,
8786
)
8887
return validated_json(apispec.AppResponse, self._dump_app(app))
8988

components/renku_data_services/renku_apps/repository.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ async def update_app(
9898
user: base_models.APIUser,
9999
app_name: str,
100100
state: apispec.AppState | None = None,
101-
resource_class_id: int | None = None,
102101
) -> App:
103102
"""Update an app."""
104103
if not user.is_authenticated or user.id is None:
@@ -115,12 +114,12 @@ async def update_app(
115114
raise errors.MissingResourceError(message=_app_not_found_message(app_name))
116115

117116
latest: AppRuntimeState = runtime_state
118-
if resource_class_id is not None:
119-
resource_class = await self.rp_repo.get_resource_class(user, resource_class_id)
120-
latest = await self.k8s_client.set_app_deployment_resources(app_name, resource_class)
121117
if state == apispec.AppState.hibernated and not runtime_state.is_hibernated:
122118
latest = await self.k8s_client.hibernate_app_deployment(app_name)
123119
elif state == apispec.AppState.running and runtime_state.is_hibernated:
120+
if launcher.resource_class_id is not None:
121+
resource_class = await self.rp_repo.get_resource_class(user, launcher.resource_class_id)
122+
await self.k8s_client.set_app_deployment_resources(app_name, resource_class)
124123
latest = await self.k8s_client.resume_app_deployment(app_name)
125124

126125
return build_app(launcher, latest)

0 commit comments

Comments
 (0)