Skip to content

Commit

Permalink
squashme: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Sep 27, 2024
1 parent 73758f6 commit f90d362
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion components/renku_data_services/notebooks/api.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,11 +1022,12 @@ components:
storage_id:
allOf:
- "$ref": "#/components/schemas/Ulid"
- description: If the storage_id is provided then this config must replace an existing storage config in the session
- description: The storage ID is used to know which storage config from the DB should be overriden
required:
- configuration
- source_path
- target_path
- storage_id
ServerName:
type: string
minLength: 5
Expand Down
4 changes: 2 additions & 2 deletions components/renku_data_services/notebooks/apispec.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ class SessionCloudStoragePost(BaseAPISpec):
readonly: bool = True
source_path: str
target_path: str
storage_id: Optional[str] = Field(
None,
storage_id: str = Field(
...,
description="ULID identifier",
max_length=26,
min_length=26,
Expand Down
14 changes: 9 additions & 5 deletions components/renku_data_services/notebooks/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,18 @@ async def _handler(
name=None,
)
for s in body.cloudstorage or []
if s.storage_id is not None
}
# NOTE: Check the cloud storage in the request body and if any match
# then overwrite the projects cloud storages
# NOTE: Cloud storages in the session launch request body that are not form the DB are ignored
# NOTE: Cloud storages in the session launch request body that are not form the DB will cause a 422 error
for csr_id, csr in cloud_storage_request.items():
if csr_id in cloud_storage:
cloud_storage[csr_id] = csr
if csr_id not in cloud_storage:
raise errors.MissingResourceError(
message=f"You have requested a cloud storage with ID {csr_id} which does not exist "
"or you dont have access to.",
quiet=True,
)
cloud_storage[csr_id] = csr
# repositories = [Repository(i.url, branch=i.branch, commit_sha=i.commit_sha) for i in body.repositories]
repositories = [Repository(url=i) for i in project.repositories]
secrets_to_create: list[V1Secret] = []
Expand All @@ -877,7 +881,7 @@ async def _handler(
is_image_private=False,
internal_gitlab_user=internal_gitlab_user,
)
# Generate the cloud starge secrets
# Generate the cloud storage secrets
data_sources: list[DataSource] = []
for ics, cs in enumerate(cloud_storage.values()):
secret_name = f"{server_name}-ds-{ics}"
Expand Down

0 comments on commit f90d362

Please sign in to comment.