runtime/tests: Update annotation for initdata

Let's rename the runtime-rs initdata annotation from
`io.katacontainers.config.runtime.cc_init_data` to
`io.katacontainers.config.hypervisor.cc_init_data`.

Rationale:
- initdata itself is a hypervisor-specific feature
- the new name aligns with the annotation handling logic:
c92bb1aa88/src/libs/kata-types/src/annotations/mod.rs (L514-L968)

This commit updates the annotation for go-runtime and tests accordingly.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
This commit is contained in:
Hyounggyu Choi 2025-08-19 12:23:15 +02:00
parent c92bb1aa88
commit 93ec470928
3 changed files with 6 additions and 3 deletions

View File

@ -885,6 +885,9 @@ func TestAddRuntimeAnnotations(t *testing.T) {
runtimeConfig := RuntimeConfig{
HypervisorType: vc.QemuHypervisor,
HypervisorConfig: vc.HypervisorConfig{
EnableAnnotations: []string{"cc_init_data"},
},
}
ocispec.Annotations[vcAnnotations.DisableGuestSeccomp] = "true"

View File

@ -245,7 +245,7 @@ const (
EnableRootlessHypervisor = kataAnnotHypervisorPrefix + "rootless"
// Initdata is the initdata passed in when CreateVM
Initdata = kataConfAnnotationsPrefix + "runtime.cc_init_data"
Initdata = kataConfAnnotationsPrefix + "hypervisor.cc_init_data"
)
// Runtime related annotations

View File

@ -174,7 +174,7 @@ function create_coco_pod_yaml() {
# This function creates pod yaml. Parameters
# - $1: image reference
# - $2: annotation `io.katacontainers.config.hypervisor.kernel_params`
# - $3: anootation `io.katacontainers.config.runtime.cc_init_data`
# - $3: annotation `io.katacontainers.config.hypervisor.cc_init_data`
# - $4: node
function create_coco_pod_yaml_with_annotations() {
image=$1
@ -183,7 +183,7 @@ function create_coco_pod_yaml_with_annotations() {
node=${4:-}
kernel_params_annotation_key="io.katacontainers.config.hypervisor.kernel_params"
cc_initdata_annotation_key="io.katacontainers.config.runtime.cc_init_data"
cc_initdata_annotation_key="io.katacontainers.config.hypervisor.cc_init_data"
# Note: this is not local as we use it in the caller test
kata_pod="$(new_pod_config "$image" "kata-${KATA_HYPERVISOR}")"