Skip to content

Commit 7aec8ca

Browse files
committed
controllers: support addon artifact images
Add support for installing custom kernel/initrd artifacts from container images in DaemonSet mode. Introduces osc-kata-addons-install.sh script and ConfigMap-based configuration (kata-addon-artifacts). Reuses extract_container_image from lib.sh. Minimal changes to existing flows. Provider-specific config updates (configuration-se.toml, configuration-tdx.toml, etc.) based on ConfigMap provider field. Signed-off-by: ANJANA-ARK <[email protected]>
1 parent 775355f commit 7aec8ca

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

config/baremetal/kata-addon-artifacts.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: kata-addon-artifacts
55
namespace: openshift-sandboxed-containers-operator
66
data:
7-
addonImage: "quay.io/ajvictor/kata-se-artifacts:v1.0"
7+
addonImage: "quay.io/<username>/kata-se-artifacts:v1.0"
88

99
# Required: Provider type (se, tdx, snp, etc.)
1010
# This determines which config file to update: kata-<provider>/configuration.toml
@@ -16,4 +16,5 @@ data:
1616
# Optional: Path within the container image where initrd is located
1717
initrdPath: "/artifacts/initrd/kata-containers-initrd.img"
1818

19-
version: "v1.0"
19+
# Define the OSC version
20+
version: "v1.11"

scripts/kata-install/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN mkdir -p /scripts
88

99
ADD osc-kata-install.sh osc-configs-script.sh osc-log-level.sh lib.sh osc-kata-install.sh osc-kata-addons-install.sh /scripts/
1010

11-
RUN curl -sSL "https://github.com/opencontainers/umoci/releases/download/v0.5.0/umoci.linux.s390x" -o "/usr/local/bin/umoci" &&\
11+
RUN curl -sSL "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" -o "/usr/local/bin/umoci" &&\
1212
chmod +x "/usr/local/bin/umoci"
1313

1414
CMD ["/scripts/osc-kata-install.sh"]

scripts/kata-install/osc-kata-addons-install.sh

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,8 @@ update_provider_config() {
6565
fi
6666
fi
6767
echo " Updated initrd: $initrd_path"
68-
else
69-
echo "No initrd path provided — commenting out existing initrd entries"
70-
sed -i 's|^\(initrd[[:space:]]*=\)|# \1|g' "$config_file"
7168
fi
7269

73-
#Update confidential_guest
74-
local conf_guest_pattern='^[[:space:]]*#*[[:space:]]*confidential_guest[[:space:]]*='
75-
76-
if [ -n "$kernel_path" ] && [ -z "$initrd_path" ]; then
77-
# Only kernel provided — enable confidential_guest
78-
echo "Only kernel provided — enabling confidential_guest"
79-
# Uncomment or add confidential_guest = true
80-
if grep -Eq "$conf_guest_pattern" "$config_file"; then
81-
sed -i 's|^[[:space:]]*#*[[:space:]]*confidential_guest[[:space:]]*=.*|confidential_guest = true|g' "$config_file"
82-
else
83-
echo "confidential_guest = true" >> "$config_file"
84-
fi
85-
elif [ -n "$kernel_path" ] && [ -n "$initrd_path" ]; then
86-
# Both kernel and initrd provided — disable confidential_guest
87-
echo "Kernel and initrd provided — commenting confidential_guest"
88-
sed -i 's|^[[:space:]]*confidential_guest[[:space:]]*=.*|# confidential_guest = true|g' "$config_file"
89-
else
90-
echo "No kernel path provided — leaving confidential_guest unchanged"
91-
fi
92-
9370
return 0
9471
}
9572

0 commit comments

Comments
 (0)