@@ -32,7 +32,7 @@ type DeploymentOpt struct {
3232 // files mounted at /etc/buildkitd
3333 ConfigFiles map [string ][]byte
3434
35- BuildKitRootFolderMemory string
35+ BuildKitRootVolumeMemory string
3636 Rootless bool
3737 NodeSelector map [string ]string
3838 CustomAnnotations map [string ]string
@@ -51,7 +51,8 @@ const (
5151 containerName = "buildkitd"
5252 AnnotationPlatform = "buildx.docker.com/platform"
5353 LabelApp = "app"
54- rootVolumeName = "buildkit-root"
54+ rootVolumeName = "buildkit-memory"
55+ rootVolumePath = "/var/lib/buildkit"
5556)
5657
5758type ErrReservedAnnotationPlatform struct {}
@@ -249,23 +250,23 @@ func NewDeployment(opt *DeploymentOpt) (d *appsv1.Deployment, c []*corev1.Config
249250 d .Spec .Template .Spec .Containers [0 ].Resources .Limits [corev1 .ResourceEphemeralStorage ] = limEphemeralStorage
250251 }
251252
252- if opt .BuildKitRootFolderMemory != "" {
253- buildKitRootFolderMemory , err := resource .ParseQuantity (opt .BuildKitRootFolderMemory )
253+ if opt .BuildKitRootVolumeMemory != "" {
254+ buildKitRootVolumeMemory , err := resource .ParseQuantity (opt .BuildKitRootVolumeMemory )
254255 if err != nil {
255256 return nil , nil , err
256257 }
257258 d .Spec .Template .Spec .Volumes = append (d .Spec .Template .Spec .Volumes , corev1.Volume {
258- Name : "buildkit-memory" ,
259+ Name : rootVolumeName ,
259260 VolumeSource : corev1.VolumeSource {
260261 EmptyDir : & corev1.EmptyDirVolumeSource {
261262 Medium : "Memory" ,
262- SizeLimit : & buildKitRootFolderMemory ,
263+ SizeLimit : & buildKitRootVolumeMemory ,
263264 },
264265 },
265266 })
266267 d .Spec .Template .Spec .Containers [0 ].VolumeMounts = append (d .Spec .Template .Spec .Containers [0 ].VolumeMounts , corev1.VolumeMount {
267- Name : "buildkit-memory" ,
268- MountPath : "/var/lib/buildkit" ,
268+ Name : rootVolumeName ,
269+ MountPath : rootVolumePath ,
269270 })
270271 }
271272
0 commit comments