Skip to content

Commit

Permalink
Remove pipe char from username passed to kubernetes because it was fa…
Browse files Browse the repository at this point in the history
…iling to create pod
  • Loading branch information
Peter Nemere committed Dec 7, 2023
1 parent da73ca9 commit a2bed24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/quantification/quantRunner/runnerKubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ func getPodObject(paramsStr string, params PiquantParams, dockerImage string, jo
// PiQuant Map Commands will need much more CPU (and can safely request it since they are running on Fargate nodes)
cpu = "3500m"
}

// Kubernetes doesn't like | in owner name, so we swap it for a _ here
safeUserId := strings.ReplaceAll(requestorUserId, "|", "_")

return &apiv1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: jobid + "-" + parts[0],
Expand All @@ -129,7 +133,7 @@ func getPodObject(paramsStr string, params PiquantParams, dockerImage string, jo
"app.kubernetes.io/component": application,
"piquant/command": params.Command,
"app": node,
"owner": requestorUserId,
"owner": safeUserId,
"jobid": jobid,
"numberofpods": strconv.Itoa(length),
},
Expand Down

0 comments on commit a2bed24

Please sign in to comment.