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,17 +950,22 @@ func ContainerConfig(ocispec specs.Spec, bundlePath, cid, console string, detach
|
|||||||
RootFs: rootfs,
|
RootFs: rootfs,
|
||||||
ReadonlyRootfs: ocispec.Root.Readonly,
|
ReadonlyRootfs: ocispec.Root.Readonly,
|
||||||
Cmd: cmd,
|
Cmd: cmd,
|
||||||
Annotations: map[string]string{
|
Annotations: ocispec.Annotations,
|
||||||
vcAnnotations.BundlePathKey: bundlePath,
|
Mounts: containerMounts(ocispec),
|
||||||
},
|
DeviceInfos: deviceInfos,
|
||||||
Mounts: containerMounts(ocispec),
|
Resources: *ocispec.Linux.Resources,
|
||||||
DeviceInfos: deviceInfos,
|
|
||||||
Resources: *ocispec.Linux.Resources,
|
|
||||||
|
|
||||||
// This is a custom OCI spec modified at SetEphemeralStorageType()
|
// This is a custom OCI spec modified at SetEphemeralStorageType()
|
||||||
// to support ephemeral storage and k8s empty dir.
|
// to support ephemeral storage and k8s empty dir.
|
||||||
CustomSpec: &ocispec,
|
CustomSpec: &ocispec,
|
||||||
}
|
}
|
||||||
|
if containerConfig.Annotations == nil {
|
||||||
|
containerConfig.Annotations = map[string]string{
|
||||||
|
vcAnnotations.BundlePathKey: bundlePath,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
containerConfig.Annotations[vcAnnotations.BundlePathKey] = bundlePath
|
||||||
|
}
|
||||||
|
|
||||||
cType, err := ContainerType(ocispec)
|
cType, err := ContainerType(ocispec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user