Skip to content

Commit 311096b

Browse files
committed
add project slug and project namespace as labels
1 parent e59d1f3 commit 311096b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

components/renku_data_services/renku_apps/k8s_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def create_app_deployment(
4141
cluster_id: ClusterId = DEFAULT_K8S_CLUSTER
4242
cluster = await self.__client.cluster_by_id(cluster_id)
4343
app_name = _generate_app_name(project)
44-
manifest = _build_app_deployment_manifest(session_launcher, app_name, resource_class)
44+
manifest = _build_app_deployment_manifest(session_launcher, app_name, resource_class, project)
4545
meta = K8sObjectMeta(
4646
name=app_name,
4747
namespace=cluster.namespace,
@@ -109,7 +109,7 @@ def _resources_from_resource_class(resource_class: ResourceClass) -> dict[str, A
109109

110110

111111
def _build_app_deployment_manifest(
112-
session_launcher: SessionLauncher, app_name: str, resource_class: ResourceClass | None
112+
session_launcher: SessionLauncher, app_name: str, resource_class: ResourceClass | None, project: Project
113113
) -> KnativeService:
114114
"""Build a Knative Service manifest derived from the session launcher."""
115115
environment = session_launcher.environment
@@ -141,6 +141,8 @@ def _build_app_deployment_manifest(
141141
"name": app_name,
142142
"labels": {
143143
"renku.io/safe-username": DUMMY_RENKU_APP_USER_ID,
144+
"renku.io/project-slug": project.slug.lower(),
145+
"renku.io/project-namespace": project.namespace.path.serialize().replace("/", "-").lower(),
144146
},
145147
"annotations": {
146148
"renku.io/launcher_id": str(session_launcher.id),

0 commit comments

Comments
 (0)