Skip to content

Commit

Permalink
fix(k8s): fix status check for our K8s deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald authored and eysi09 committed Oct 27, 2018
1 parent 45255ca commit 35187d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions garden-service/src/plugins/kubernetes/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ export async function createDeployment(

if (enableHotReload) {
configureHotReload(deployment, container, spec, module.spec, env, imageId)
} else {
deployment.spec.template.spec.containers = [container]
}

if (!deployment.spec.template.spec.volumes.length) {
// this is important for status checks to work correctly
delete deployment.spec.template.spec.volumes
}

return deployment
Expand Down Expand Up @@ -293,7 +296,6 @@ function deploymentConfig(
// TODO: set this for non-system pods
// automountServiceAccountToken: false, // this prevents the pod from accessing the kubernetes API
containers: [],
initContainers: [],
// TODO: make restartPolicy configurable
restartPolicy: "Always",
terminationGracePeriodSeconds: 10,
Expand Down Expand Up @@ -459,7 +461,7 @@ function configureHotReload(deployment, container, serviceSpec, moduleSpec, env,
emptyDir: {},
})

deployment.spec.template.spec.initContainers.push(initContainer)
deployment.spec.template.spec.initContainers = [initContainer]

deployment.spec.template.spec.containers = [container, rsyncContainer]

Expand Down

0 comments on commit 35187d3

Please sign in to comment.