ContainerConfig: Set ocispec.Annotations to containerConfig.Annotations
ocispec.Annotations is dropped in ContainerConfig.
This commit let it to be set to containerConfig.Annotations in
ContainerConfig.
Fixes:
@@ -950,9 +950,7 @@ func ContainerConfig(ocispec specs.Spec, bundlePath, cid, console string, detach
RootFs: rootfs,
ReadonlyRootfs: ocispec.Root.Readonly,
Cmd: cmd,
- Annotations: map[string]string{
- vcAnnotations.BundlePathKey: bundlePath,
- },
+ Annotations: ocispec.Annotations,
Mounts: containerMounts(ocispec),
DeviceInfos: deviceInfos,
Resources: *ocispec.Linux.Resources,
@@ -961,6 +959,13 @@ func ContainerConfig(ocispec specs.Spec, bundlePath, cid, console string, detach
// to support ephemeral storage and k8s empty dir.
CustomSpec: &ocispec,
}
+ if containerConfig.Annotations == nil {
+ containerConfig.Annotations = map[string]string{
+ vcAnnotations.BundlePathKey: bundlePath,
+ }
+ } else {
+ containerConfig.Annotations[vcAnnotations.BundlePathKey] = bundlePath
+ }
cType, err := ContainerType(ocispec)
if err != nil {
