Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfisher committed May 17, 2024
1 parent b1e4607 commit 566d033
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/workloads/console/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,8 @@ func (r *ConsoleReconciler) buildJob(logger logr.Logger, name types.NamespacedNa
container.Stdin = true
container.TTY = true
}

container.Env = append(container.Env, corev1.EnvVar{Name: "UTOPIA_CONSOLE_USER", Value: csl.Spec.User})
}

if numContainers > 1 {
Expand Down
4 changes: 4 additions & 0 deletions controllers/workloads/console/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ var _ = Describe("Console", func() {
job.Spec.Template.Spec.Containers[0].Args).To(Equal([]string{"console", "--help"}),
"job's args does not match the other command elements in the spec",
)
Expect(
job.Spec.Template.Spec.Containers[0].Env).To(ContainElement(corev1.EnvVar{Name: "UTOPIA_CONSOLE_USER", Value: "admin"}),
"job's env does not contain valid UTOPIA_CONSOLE_USER",
)
Expect(
*job.Spec.BackoffLimit).To(BeNumerically("==", 0),
"job's BackoffLimit is not 0",
Expand Down

0 comments on commit 566d033

Please sign in to comment.