Skip to content

Commit

Permalink
test: added assertion for local-mode config
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Jul 13, 2022
1 parent 869bdda commit 3419cb6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { apply } from "../../../../../../src/plugins/kubernetes/kubectl"
import { getAppNamespace } from "../../../../../../src/plugins/kubernetes/namespace"
import { gardenAnnotationKey } from "../../../../../../src/util/string"
import {
k8sReverseProxyImageName,
k8sSyncUtilImageName,
PROXY_CONTAINER_SSH_TUNNEL_PORT,
PROXY_CONTAINER_SSH_TUNNEL_PORT_NAME,
Expand Down Expand Up @@ -79,6 +80,11 @@ describe("kubernetes container deployment handlers", () => {
expect(appContainerSpec!.args).to.eql([])
}

function expectProxyContainerImage(workload: KubernetesWorkload) {
const appContainerSpec = workload.spec.template?.spec?.containers.find((c) => c.name === "local-mode")
expect(appContainerSpec!.image).to.eql(k8sReverseProxyImageName)
}

function expectContainerEnvVars(workload: KubernetesWorkload) {
const appContainerSpec = workload.spec.template?.spec?.containers.find((c) => c.name === "local-mode")
const env = appContainerSpec!.env!
Expand Down Expand Up @@ -193,7 +199,7 @@ describe("kubernetes container deployment handlers", () => {
expectSshContainerPort(workload)
})

it("Workflow should have empty container args when in local mode", async () => {
it("Workflow should have proxy container image and empty container args when in local mode", async () => {
const service = graph.getService("local-mode")

const { workload } = await createContainerManifests({
Expand All @@ -208,6 +214,7 @@ describe("kubernetes container deployment handlers", () => {
blueGreen: false,
})

expectProxyContainerImage(workload)
expectEmptyContainerArgs(workload)
})

Expand Down

0 comments on commit 3419cb6

Please sign in to comment.