Skip to content

Commit

Permalink
Set environment variable and data variable for policy name.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed May 6, 2022
1 parent 6af4a2c commit 337d91a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions session-manager/handlers/workshopsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,10 @@ def resolve_security_policy(name):
"name": "POLICY_ENGINE",
"value": CLUSTER_SECURITY_POLICY_ENGINE,
},
{
"name": "POLICY_NAME",
"value": namespace_security_policy,
},
],
"volumeMounts": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export let config = {
ingress_class: process.env.INGRESS_CLASS || "",
storage_class: process.env.STORAGE_CLASS || "",
policy_engine: process.env.POLICY_ENGINE || "none",
policy_name: process.env.POLICY_NAME || "restricted",

// Google analytics tracking ID.

Expand Down Expand Up @@ -114,6 +115,7 @@ config.variables.push({ name: "ingress_port_suffix", content: config.ingress_por
config.variables.push({ name: "ingress_class", content: config.ingress_class })
config.variables.push({ name: "storage_class", content: config.storage_class })
config.variables.push({ name: "policy_engine", content: config.policy_engine })
config.variables.push({ name: "policy_name", content: config.policy_name })

if (fs.existsSync("/var/run/secrets/kubernetes.io/serviceaccount/token")) {
let data = fs.readFileSync("/var/run/secrets/kubernetes.io/serviceaccount/token")
Expand Down

0 comments on commit 337d91a

Please sign in to comment.