Skip to content

Commit

Permalink
ContainerConfig: Set ocispec.Annotations to containerConfig.Annotations
Browse files Browse the repository at this point in the history
ocispec.Annotations is dropped in ContainerConfig.
This commit let it to be set to containerConfig.Annotations in
ContainerConfig.

Fixes: kata-containers#2201

Signed-off-by: Hui Zhu <teawater@antfin.com>
  • Loading branch information
teawater committed Jul 10, 2021
1 parent 73fe253 commit 9de3a2d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/runtime/virtcontainers/pkg/oci/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,17 +950,16 @@ 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,
},
Mounts: containerMounts(ocispec),
DeviceInfos: deviceInfos,
Resources: *ocispec.Linux.Resources,
Annotations: ocispec.Annotations,
Mounts: containerMounts(ocispec),
DeviceInfos: deviceInfos,
Resources: *ocispec.Linux.Resources,

// This is a custom OCI spec modified at SetEphemeralStorageType()
// to support ephemeral storage and k8s empty dir.
CustomSpec: &ocispec,
}
containerConfig.Annotations[vcAnnotations.BundlePathKey] = bundlePath

cType, err := ContainerType(ocispec)
if err != nil {
Expand Down

0 comments on commit 9de3a2d

Please sign in to comment.