From ea5ee5a555f0eadac8d0be7297fb469b5a32cf08 Mon Sep 17 00:00:00 2001 From: Sandhya Dasu Date: Thu, 8 Aug 2019 16:04:27 -0400 Subject: [PATCH] Add volume type to represent shared volume for the containers in a Baremetal deployment --- ...machine-api-operator_13_baremetalhost.crd.yaml} | 0 pkg/operator/baremetal_pod.go | 14 +++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) rename install/{0000_30_machine-api-operator_12_baremetalhost.crd.yaml => 0000_30_machine-api-operator_13_baremetalhost.crd.yaml} (100%) diff --git a/install/0000_30_machine-api-operator_12_baremetalhost.crd.yaml b/install/0000_30_machine-api-operator_13_baremetalhost.crd.yaml similarity index 100% rename from install/0000_30_machine-api-operator_12_baremetalhost.crd.yaml rename to install/0000_30_machine-api-operator_13_baremetalhost.crd.yaml diff --git a/pkg/operator/baremetal_pod.go b/pkg/operator/baremetal_pod.go index 1861ad5385..5f7d3327e4 100644 --- a/pkg/operator/baremetal_pod.go +++ b/pkg/operator/baremetal_pod.go @@ -8,9 +8,20 @@ import ( ) var baremetalConfigmap = "metal3-config" +var sharedVolume = "metal3-shared" + +var volumes = []corev1.Volume{ + { + Name: sharedVolume, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, +} + var volumeMounts = []corev1.VolumeMount{ { - Name: "metal3-shared", + Name: sharedVolume, MountPath: "/shared", }, } @@ -103,6 +114,7 @@ func newMetal3PodTemplateSpec(config *OperatorConfig) *corev1.PodTemplateSpec { }, }, Spec: corev1.PodSpec{ + Volumes: volumes, InitContainers: initContainers, Containers: containers, PriorityClassName: "system-node-critical",