Skip to content

Commit

Permalink
squashme: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Oct 24, 2024
1 parent ed2325a commit 3062e07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
11 changes: 6 additions & 5 deletions components/renku_data_services/notebooks/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,12 @@ async def _handler(
)
if csr.target_path is not None and not PurePosixPath(csr.target_path).is_absolute():
csr.target_path = (work_dir / csr.target_path).as_posix()
if csr_id in dcs_secrets and csr.configuration is not None:
raise errors.ValidationError(
message=f"Overriding the storage configuration for storage with ID {csr_id} "
"is not allowed because the storage has an associated saved secret.",
)
# TODO: The UI always does this check if it is acceptable/safe
# if csr_id in dcs_secrets and csr.configuration is not None:
# raise errors.ValidationError(
# message=f"Overriding the storage configuration for storage with ID {csr_id} "
# "is not allowed because the storage has an associated saved secret.",
# )
dcs[csr_id] = dcs[csr_id].with_override(csr)
repositories = [Repository(url=i) for i in project.repositories]
secrets_to_create: list[V1Secret] = []
Expand Down
6 changes: 3 additions & 3 deletions components/renku_data_services/notebooks/util/kubernetes_.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def renku_2_make_server_name(safe_username: str, project_id: str, launcher_id: s
# Must be no more than 63 characters because the name is used to create a k8s Service and Services
# have more restrictions for their names beacuse their names have to make a valid hostname.
# NOTE: We use server name as a label value, so, server name must be less than 63 characters.
# !NOTE: For now we limit the server name to a max of 42 characters.
# NOTE: This is 12 + 9 + 21 = 42 characters
return f"{prefix[:12]}-renku-2-{server_hash[:21]}"
# !NOTE: For now we limit the server name to a max of 25 characters.
# NOTE: This is 12 + 1 + 12 = 25 characters
return f"{prefix[:12]}-{server_hash[:12]}"


def find_env_var(container: V1Container, env_name: str) -> tuple[int, str] | None:
Expand Down
4 changes: 3 additions & 1 deletion test/bases/renku_data_services/data_api/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,9 @@ async def test_project_slug_case(
assert res.json.get("slug") == uppercase_slug
etag = res.headers["ETag"]
# Get it by the namespace
_, res = await sanic_client.get(f"/api/data/projects/{group['slug']}/{uppercase_slug}", headers=user_headers)
_, res = await sanic_client.get(
f"/api/data/namespaces/{group['slug']}/projects/{uppercase_slug}", headers=user_headers
)
assert res.status_code == 200
assert res.json.get("slug") == uppercase_slug
# Patch the project
Expand Down

0 comments on commit 3062e07

Please sign in to comment.