Skip to content

Commit

Permalink
Change variable naming for OCI image cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Jul 31, 2023
1 parent f8205b7 commit 504cfb3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions session-manager/handlers/workshopenvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@ def workshop_environment_create(
if xget(workshop_spec, "environment.assets.ingress.enabled", False):
assets_repository = f"assets-{workshop_namespace}.{INGRESS_DOMAIN}"

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

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

environment_downloads_variables = dict(
platform_arch=PLATFORM_ARCH,
image_repository=image_repository,
workshop_image_cache=workshop_image_cache,
oci_image_cache=oci_image_cache,
assets_repository=assets_repository,
workshop_name=workshop_name,
environment_name=environment_name,
Expand Down Expand Up @@ -939,7 +939,7 @@ def workshop_environment_create(
environment_variables = dict(
platform_arch=PLATFORM_ARCH,
image_repository=image_repository,
workshop_image_cache=workshop_image_cache,
oci_image_cache=oci_image_cache,
assets_repository=assets_repository,
service_account=f"{OPERATOR_NAME_PREFIX}-services",
workshop_name=workshop_name,
Expand Down
10 changes: 5 additions & 5 deletions session-manager/handlers/workshopsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,10 +904,10 @@ def resolve_security_policy(name):
if xget(workshop_spec, "environment.assets.ingress.enabled", False):
assets_repository = f"assets-{workshop_namespace}.{INGRESS_DOMAIN}"

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

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

image_registry_host = xget(environment_instance.obj, "spec.registry.host")
image_registry_namespace = xget(environment_instance.obj, "spec.registry.namespace")
Expand All @@ -921,7 +921,7 @@ def resolve_security_policy(name):
session_variables = dict(
platform_arch=PLATFORM_ARCH,
image_repository=image_repository,
workshop_image_cache=workshop_image_cache,
oci_image_cache=oci_image_cache,
assets_repository=assets_repository,
session_id=session_id,
session_name=session_name,
Expand Down Expand Up @@ -1507,8 +1507,8 @@ def resolve_security_policy(name):
"value": image_repository,
},
{
"name": "WORKSHOP_IMAGE_CACHE",
"value": workshop_image_cache,
"name": "OCI_IMAGE_CACHE",
"value": oci_image_cache,
},
{
"name": "ASSETS_REPOSITORY",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#@ add_param_from_environ("amplitude_tracking_id")

#@ add_param_from_environ("image_repository")
#@ add_param_from_environ("workshop_image_cache")
#@ add_param_from_environ("oci_image_cache")
#@ add_param_from_environ("assets_repository")
#@ add_param_from_environ("workshop_name")
#@ add_param_from_environ("session_name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const RESTART_URL = process.env.RESTART_URL
const FINISHED_MSG = process.env.FINISHED_MSG

const IMAGE_REPOSITORY = process.env.IMAGE_REPOSITORY || "registry.default.svc.cluster.local"
const WORKSHOP_IMAGE_CACHE = process.env.WORKSHOP_IMAGE_CACHE || "workshop-images"
const OCI_IMAGE_CACHE = process.env.OCI_IMAGE_CACHE || "workshop-images"
const ASSETS_REPOSITORY = process.env.ASSETS_REPOSITORY || "workshop-assets"

const SERVICES_PASSWORD = process.env.SERVICES_PASSWORD
Expand Down Expand Up @@ -163,7 +163,7 @@ export let config = {
kubernetes_token: kubernetes_token(),

image_repository: IMAGE_REPOSITORY,
workshop_image_cache: WORKSHOP_IMAGE_CACHE,
oci_image_cache: OCI_IMAGE_CACHE,
assets_repository: ASSETS_REPOSITORY,

services_password: SERVICES_PASSWORD,
Expand All @@ -179,7 +179,7 @@ function substitute_session_params(value: any) {

value = value.split("$(platform_arch)").join(config.platform_arch)
value = value.split("$(image_repository)").join(config.image_repository)
value = value.split("$(workshop_image_cache)").join(config.workshop_image_cache)
value = value.split("$(oci_image_cache)").join(config.oci_image_cache)
value = value.split("$(assets_repository)").join(config.assets_repository)
value = value.split("$(environment_name)").join(config.environment_name)
value = value.split("$(workshop_namespace)").join(config.workshop_namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export let config = {

platform_arch: process.env.PLATFORM_ARCH || "",
image_repository: process.env.IMAGE_REPOSITORY || "registry.default.svc.cluster.local",
workshop_image_cache: process.env.WORKSHOP_IMAGE_CACHE || "workshop-images",
oci_image_cache: process.env.OCI_IMAGE_CACHE || "workshop-images",
assets_repository: process.env.ASSETS_REPOSITORY || "workshop-assets",
workshop_name: process.env.WORKSHOP_NAME || "workshop",
session_name: process.env.SESSION_NAME || "workshop",
Expand Down Expand Up @@ -116,7 +116,7 @@ export let config = {

config.variables.push({ name: "platform_arch", content: config.platform_arch })
config.variables.push({ name: "image_repository", content: config.image_repository })
config.variables.push({ name: "workshop_image_cache", content: config.workshop_image_cache })
config.variables.push({ name: "oci_image_cache", content: config.oci_image_cache })
config.variables.push({ name: "assets_repository", content: config.assets_repository })
config.variables.push({ name: "workshop_name", content: config.workshop_name })
config.variables.push({ name: "session_name", content: config.session_name })
Expand Down

0 comments on commit 504cfb3

Please sign in to comment.