Skip to content

Commit 7234584

Browse files
authored
fix(sessions): use image pull secret from private build registry correctly (#1274)
* fix: don-t recreate private image pull secret When retrieving the image pull secret to be used by a session, if it's an existing secret, do not add it to the extra resources to be created. This is the case for the registry used to store the images built out of private repositories.
1 parent 814d1e6 commit 7234584

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

components/renku_data_services/notebooks/core_sessions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,8 @@ async def start_session(
928928
image_check_repo=image_check_repo,
929929
builds_config=builds_config,
930930
)
931-
if image_secret:
931+
932+
if image_secret and image_secret.secret.data is not None:
932933
session_extras = session_extras.concat(SessionExtraResources(secrets=[image_secret]))
933934

934935
# Remote session configuration
@@ -1243,7 +1244,8 @@ async def patch_session(
12431244
builds_config=builds_config,
12441245
)
12451246
if image_pull_secret:
1246-
session_extras = session_extras.concat(SessionExtraResources(secrets=[image_pull_secret]))
1247+
if image_pull_secret.secret.data is not None:
1248+
session_extras = session_extras.concat(SessionExtraResources(secrets=[image_pull_secret]))
12471249
patch.spec.imagePullSecrets = [ImagePullSecret(name=image_pull_secret.name, adopt=image_pull_secret.adopt)]
12481250
else:
12491251
patch.spec.imagePullSecrets = RESET

0 commit comments

Comments
 (0)