Skip to content

Commit

Permalink
feat: allow restart policy to be set by users
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbreuninger committed Nov 19, 2024
1 parent f65d783 commit 3848817
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hack/provider/provider-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ options:
description: "If defined, will automatically stop the pod after the inactivity period. Examples: 10m, 1h"
POD_TIMEOUT:
description: "Determines how long the provider waits for the workspace pod to come up. Examples: 10m, 1h"
default: 10s
default: 10m
STORAGE_CLASS:
description: If defined, DevPod will use the given storage class to create the persistent volume claim. You will need to ensure the storage class exists in your cluster!
global: true
Expand Down
4 changes: 3 additions & 1 deletion pkg/kubernetes/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func (k *KubernetesDriver) runContainer(
Kind: "Pod",
APIVersion: corev1.SchemeGroupVersion.String(),
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyNever,
},
}
if len(k.options.PodManifestTemplate) > 0 {
k.Log.Debugf("trying to get pod template manifest from %s", k.options.PodManifestTemplate)
Expand Down Expand Up @@ -216,7 +219,6 @@ func (k *KubernetesDriver) runContainer(
pod.Spec.InitContainers = initContainers
pod.Spec.Containers = getContainers(pod, options.Image, options.Entrypoint, options.Cmd, envVars, volumeMounts, capabilities, resources, options.Privileged, k.options.DangerouslyOverrideImage, k.options.StrictSecurity)
pod.Spec.Volumes = getVolumes(pod, id)
pod.Spec.RestartPolicy = corev1.RestartPolicyNever

affinity := false
stdout := &bytes.Buffer{}
Expand Down

0 comments on commit 3848817

Please sign in to comment.