|
| 1 | +From 872bd7a7aceb7ef83ee23e93fa6ff7cf440f5c80 Mon Sep 17 00:00:00 2001 |
| 2 | +From: "Jena, Satyabrata" <satyabrata.jena@intel.com> |
| 3 | +Date: Tue, 8 Apr 2025 04:01:30 +0000 |
| 4 | +Subject: [PATCH] Necessary changes to support kata-deploy image for |
| 5 | + trusted-workload. |
| 6 | + |
| 7 | +Signed-off-by: Jena, Satyabrata <satyabrata.jena@intel.com> |
| 8 | +--- |
| 9 | + .../kata-deploy/scripts/kata-deploy.sh | 30 +++++++++++-------- |
| 10 | + 1 file changed, 17 insertions(+), 13 deletions(-) |
| 11 | + |
| 12 | +diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh |
| 13 | +index e765c0d3f..ff8600a93 100755 |
| 14 | +--- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh |
| 15 | ++++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh |
| 16 | +@@ -1,8 +1,7 @@ |
| 17 | + #!/usr/bin/env bash |
| 18 | +-# Copyright (c) 2019 Intel Corporation |
| 19 | +-# |
| 20 | +-# SPDX-License-Identifier: Apache-2.0 |
| 21 | + # |
| 22 | ++# Copyright (C) 2025 Intel Corporation |
| 23 | ++# SPDX-License-Identifier: BSD-3-Clause |
| 24 | + |
| 25 | + set -o errexit |
| 26 | + set -o pipefail |
| 27 | +@@ -509,8 +508,9 @@ function configure_cri_runtime() { |
| 28 | + elif [ "$1" == "microk8s" ]; then |
| 29 | + host_systemctl restart snap.microk8s.daemon-containerd.service |
| 30 | + else |
| 31 | +- host_systemctl daemon-reload |
| 32 | +- host_systemctl restart "$1" |
| 33 | ++ #host_systemctl daemon-reload |
| 34 | ++ #host_systemctl restart "$1" |
| 35 | ++ echo "configure_cri_runtime" |
| 36 | + fi |
| 37 | + |
| 38 | + wait_till_node_is_ready |
| 39 | +@@ -697,8 +697,9 @@ function restart_cri_runtime() { |
| 40 | + elif [ "$1" == "microk8s" ]; then |
| 41 | + host_systemctl restart snap.microk8s.daemon-containerd.service |
| 42 | + else |
| 43 | +- host_systemctl daemon-reload |
| 44 | +- host_systemctl restart "${runtime}" |
| 45 | ++ #host_systemctl daemon-reload |
| 46 | ++ #host_systemctl restart "${runtime}" |
| 47 | ++ echo "restart_cri_runtime" |
| 48 | + fi |
| 49 | + } |
| 50 | + |
| 51 | +@@ -715,7 +716,7 @@ function cleanup_cri_runtime() { |
| 52 | + [ "${HELM_POST_DELETE_HOOK}" == "false" ] && return |
| 53 | + |
| 54 | + # Only run this code in the HELM_POST_DELETE_HOOK |
| 55 | +- restart_cri_runtime "$1" |
| 56 | ++ #restart_cri_runtime "$1" |
| 57 | + } |
| 58 | + |
| 59 | + function cleanup_crio() { |
| 60 | +@@ -742,10 +743,11 @@ function cleanup_containerd() { |
| 61 | + |
| 62 | + function reset_runtime() { |
| 63 | + kubectl label node "$NODE_NAME" katacontainers.io/kata-runtime- |
| 64 | +- restart_cri_runtime "$1" |
| 65 | ++ #restart_cri_runtime "$1" |
| 66 | + |
| 67 | + if [ "$1" == "crio" ] || [ "$1" == "containerd" ]; then |
| 68 | +- host_systemctl restart kubelet |
| 69 | ++ #host_systemctl restart kubelet |
| 70 | ++ echo "reset_runtime" |
| 71 | + fi |
| 72 | + |
| 73 | + wait_till_node_is_ready |
| 74 | +@@ -891,7 +893,7 @@ function main() { |
| 75 | + fi |
| 76 | + |
| 77 | + install_artifacts |
| 78 | +- configure_cri_runtime "$runtime" |
| 79 | ++ #configure_cri_runtime "$runtime" |
| 80 | + kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true |
| 81 | + ;; |
| 82 | + cleanup) |
| 83 | +@@ -913,7 +915,9 @@ function main() { |
| 84 | + fi |
| 85 | + fi |
| 86 | + |
| 87 | +- cleanup_cri_runtime "$runtime" |
| 88 | ++ #cleanup_cri_runtime "$runtime" |
| 89 | ++ |
| 90 | ++ |
| 91 | + if [ "${HELM_POST_DELETE_HOOK}" == "false" ]; then |
| 92 | + # If we still have any other installation here, it means we'll break them |
| 93 | + # removing the label, so we just don't do it. |
| 94 | +@@ -923,7 +927,7 @@ function main() { |
| 95 | + fi |
| 96 | + fi |
| 97 | + remove_artifacts |
| 98 | +- |
| 99 | ++ kubectl label node "$NODE_NAME" confidentialcontainers.org/startuninstall- |
| 100 | + if [ "${HELM_POST_DELETE_HOOK}" == "true" ]; then |
| 101 | + # After everything was cleaned up, there's no reason to continue |
| 102 | + # and sleep forever. Let's just return success.. |
| 103 | +-- |
| 104 | +2.34.1 |
| 105 | + |
0 commit comments