Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leafty committed Dec 9, 2024
1 parent d573df3 commit 9065bbf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def user_secrets_container(

decrypted_volume_mount = ExtraVolumeMount(
name="user-secrets-volume",
mountPath=secrets_mount_directory or project_constants.DEFAULT_SESSION_MOUNT_DIR.as_posix(),
mountPath=secrets_mount_directory or project_constants.DEFAULT_SESSION_SECRETS_MOUNT_DIR.as_posix(),
readOnly=True,
)

Expand Down
4 changes: 3 additions & 1 deletion components/renku_data_services/project/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ components:
description: Shows if a project is a template or not
type: boolean
SecretsMountDirectory:
description: The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.
description: |
The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.
Relative locations are supported and will be mounted relative to the session environment's mount directory.
type: string
minLength: 1
default: "/secrets"
Expand Down
6 changes: 3 additions & 3 deletions components/renku_data_services/project/apispec.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: api.spec.yaml
# timestamp: 2024-11-27T15:24:03+00:00
# timestamp: 2024-12-09T08:12:44+00:00

from __future__ import annotations

Expand Down Expand Up @@ -421,7 +421,7 @@ class Project(BaseAPISpec):
)
secrets_mount_directory: str = Field(
...,
description="The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.",
description="The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.\nRelative locations are supported and will be mounted relative to the session environment's mount directory.\n",
example="/secrets",
min_length=1,
)
Expand Down Expand Up @@ -482,7 +482,7 @@ class ProjectPost(BaseAPISpec):
)
secrets_mount_directory: Optional[str] = Field(
None,
description="The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.",
description="The location where the secrets will be provided inside sessions, if left unset it will default to `/secrets`.\nRelative locations are supported and will be mounted relative to the session environment's mount directory.\n",
example="/secrets",
min_length=1,
)
Expand Down
5 changes: 3 additions & 2 deletions components/renku_data_services/project/constants.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Constant values used for projects."""

from pathlib import PurePosixPath
from typing import Final

DEFAULT_SESSION_MOUNT_DIR_STR = "/secrets"
DEFAULT_SESSION_SECRETS_MOUNT_DIR_STR: Final[str] = "/secrets"
"""The default location where the secrets will be provided inside sessions, as a string."""

DEFAULT_SESSION_MOUNT_DIR = PurePosixPath(DEFAULT_SESSION_MOUNT_DIR_STR)
DEFAULT_SESSION_SECRETS_MOUNT_DIR: Final[PurePosixPath] = PurePosixPath(DEFAULT_SESSION_SECRETS_MOUNT_DIR_STR)
"""The default location where the secrets will be provided inside sessions."""
2 changes: 1 addition & 1 deletion components/renku_data_services/project/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def dump(self, with_documentation: bool = False) -> models.Project:
documentation=self.documentation if with_documentation else None,
template_id=self.template_id,
is_template=self.is_template,
secrets_mount_directory=self.secrets_mount_directory or constants.DEFAULT_SESSION_MOUNT_DIR,
secrets_mount_directory=self.secrets_mount_directory or constants.DEFAULT_SESSION_SECRETS_MOUNT_DIR,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def test_adding_deleting_project(app_config_instance: Config, bootstrap_ad
),
visibility=Visibility.PUBLIC if public_project else Visibility.PRIVATE,
created_by=project_owner.id,
secrets_mount_directory=project_constants.DEFAULT_SESSION_MOUNT_DIR,
secrets_mount_directory=project_constants.DEFAULT_SESSION_SECRETS_MOUNT_DIR,
)
authz_changes = authz._add_project(project)
await authz.client.WriteRelationships(authz_changes.apply)
Expand Down

0 comments on commit 9065bbf

Please sign in to comment.