From 252d4486f1faac08a94d2997bf9ae3d7c0b67bad Mon Sep 17 00:00:00 2001 From: Saul Paredes Date: Fri, 29 Aug 2025 14:08:42 -0700 Subject: [PATCH] runtime: delete initdata annotation Delete annotation from OCI spec and sandbox config. This is done after the optional initdata annotation value has been read. Signed-off-by: Saul Paredes --- src/runtime/pkg/katautils/create.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/runtime/pkg/katautils/create.go b/src/runtime/pkg/katautils/create.go index 350a32fc54..e7752bb0cb 100644 --- a/src/runtime/pkg/katautils/create.go +++ b/src/runtime/pkg/katautils/create.go @@ -167,6 +167,10 @@ func CreateSandbox(ctx context.Context, vci vc.VC, ociSpec specs.Spec, runtimeCo delete(ociSpec.Annotations, vcAnnotations.Policy) delete(sandboxConfig.Annotations, vcAnnotations.Policy) + // The value of this annotation is sent to the sandbox using init data. + delete(ociSpec.Annotations, vcAnnotations.Initdata) + delete(sandboxConfig.Annotations, vcAnnotations.Initdata) + sandbox, err := vci.CreateSandbox(ctx, sandboxConfig, func(ctx context.Context) error { // Run pre-start OCI hooks, in the runtime namespace. if err := PreStartHooks(ctx, ociSpec, containerID, bundlePath); err != nil { @@ -236,6 +240,9 @@ func CreateContainer(ctx context.Context, sandbox vc.VCSandbox, ociSpec specs.Sp // The value of this annotation is sent to the sandbox using SetPolicy. delete(ociSpec.Annotations, vcAnnotations.Policy) + // The value of this annotation is sent to the sandbox using init data. + delete(ociSpec.Annotations, vcAnnotations.Initdata) + ociSpec = SetEphemeralStorageType(ociSpec, disableGuestEmptyDir) contConfig, err := oci.ContainerConfig(ociSpec, bundlePath, containerID, disableOutput)