mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 05:34:46 +00:00
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: #2201 Signed-off-by: Hui Zhu <teawater@antfin.com>
This commit is contained in:
parent
243d4b8689
commit
2c835b60ed
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user