Pass in imagespec.Platform to WithVolumes()

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira
2023-06-08 11:25:10 +03:00
parent b9dfd29b73
commit 6dd529e400
3 changed files with 12 additions and 4 deletions

View File

@@ -203,7 +203,14 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
for _, v := range volumeMounts {
mountMap[filepath.Clean(v.HostPath)] = v.ContainerPath
}
opts = append(opts, customopts.WithVolumes(mountMap, image.ImageSpec.OS))
platform := imagespec.Platform{
OS: image.ImageSpec.OS,
Architecture: image.ImageSpec.Architecture,
OSVersion: image.ImageSpec.OSVersion,
OSFeatures: image.ImageSpec.OSFeatures,
Variant: image.ImageSpec.Variant,
}
opts = append(opts, customopts.WithVolumes(mountMap, platform))
}
meta.ImageRef = image.ID
meta.StopSignal = image.ImageSpec.Config.StopSignal