Skip to content

Commit 022a97d

Browse files
authored
feat: allow override of volume and volumemount (#83)
This PR ensures, that the default volume and volumemount wont be created, if they are defined in podtemplate to e.g. use an PVC instead of an emptydir
1 parent a078c41 commit 022a97d

File tree

3 files changed

+483
-7
lines changed

3 files changed

+483
-7
lines changed

internal/provider/provider.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ import (
2222
"github.com/mercedes-benz/garm-provider-k8s/pkg/diff"
2323
)
2424

25+
const (
26+
runnerContainerName = "runner"
27+
)
28+
2529
type Provider struct {
2630
ControllerID string
2731
ClientSet kubernetes.Interface
@@ -54,7 +58,7 @@ func (p Provider) CreateInstance(_ context.Context, bootstrapParams params.Boots
5458
RestartPolicy: corev1.RestartPolicyNever,
5559
Containers: []corev1.Container{
5660
{
57-
Name: "runner",
61+
Name: runnerContainerName,
5862
Image: bootstrapParams.Image,
5963
Resources: resourceRequirements,
6064
Env: envs,
@@ -74,6 +78,11 @@ func (p Provider) CreateInstance(_ context.Context, bootstrapParams params.Boots
7478
return params.ProviderInstance{}, err
7579
}
7680

81+
err = spec.CreateRunnerVolumeMount(pod, runnerContainerName)
82+
if err != nil {
83+
return params.ProviderInstance{}, err
84+
}
85+
7786
mergedPod, err := mergePodSpecs(pod, config.Config.PodTemplate)
7887
if err != nil {
7988
return params.ProviderInstance{}, err

0 commit comments

Comments
 (0)