Skip to content

Commit

Permalink
Add section to workshop definition to specify init containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Jul 30, 2023
1 parent 0310500 commit 22305b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,16 @@ spec:
name:
type: string
x-kubernetes-preserve-unknown-fields: true
initContainers:
type: array
items:
type: object
required:
- name
properties:
name:
type: string
x-kubernetes-preserve-unknown-fields: true
applications:
type: object
properties:
Expand Down
14 changes: 12 additions & 2 deletions session-manager/handlers/workshopsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,10 @@ def resolve_security_policy(name):

image_repository = IMAGE_REPOSITORY

assets_repository=f"assets-server.{workshop_namespace}.svc.{CLUSTER_DOMAIN}"
assets_repository = f"assets-server.{workshop_namespace}.svc.{CLUSTER_DOMAIN}"

if xget(workshop_spec, "environment.assets.ingress.enabled", False):
assets_repository=f"assets-{workshop_namespace}.{INGRESS_DOMAIN}"
assets_repository = f"assets-{workshop_namespace}.{INGRESS_DOMAIN}"

workshop_image_cache = f"image-cache.{workshop_namespace}.svc.{CLUSTER_DOMAIN}"

Expand Down Expand Up @@ -1894,6 +1894,16 @@ def vendir_secrets_required(contents):

deployment_pod_template_spec["initContainers"].append(downloads_init_container)

# Append any init containers specified in the workshop definition.

session_init_containers = workshop_spec["session"].get("initContainers", [])

session_init_containers = substitute_variables(
session_init_containers, session_variables
)

deployment_pod_template_spec["initContainers"].extend(session_init_containers)

# Apply any patches for the pod specification for the deployment which
# are specified in the workshop resource definition. This would be used
# to set resources and setup volumes. If the target item is a list, look
Expand Down

0 comments on commit 22305b4

Please sign in to comment.