Skip to content

Commit 921fe2f

Browse files
committed
baremetal-coco: Set https / no_proxy for the agent
This is needed as that's the only way for the agent running inside the guest to know about proxies. Signed-off-by: Fabiano Fidêncio <[email protected]>
1 parent 5fb8e1b commit 921fe2f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/install-helpers/baremetal-coco/install.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ EOF
361361
function set_kernel_params_for_kata_agent() {
362362
local tee_type=${1}
363363
local trustee_url=${2}
364+
local cluster_https_proxy=${3}
365+
local cluster_no_proxy=${4}
364366
local source=""
365367
local filepath=""
366368

@@ -369,6 +371,11 @@ function set_kernel_params_for_kata_agent() {
369371
kata_override="[hypervisor.qemu]
370372
kernel_params= \"agent.aa_kbc_params=cc_kbc::$trustee_url\""
371373

374+
if [ -n "$cluster_https_proxy" ]; then
375+
kata_override="[hypervisor.qemu]
376+
kernel_params=\"agent.aa_kbc_params=cc_kbc::$trustee_url agent.https_proxy=$cluster_https_proxy agent.no_proxy=$cluster_no_proxy\""
377+
fi
378+
372379
# Create base64 encoding of the drop-in to be used as source
373380
source=$(echo "$kata_override" | base64 -w0) || return 1
374381

@@ -815,6 +822,7 @@ if [ "$MIRRORING" = true ]; then
815822
fi
816823

817824
CLUSTER_HTTPS_PROXY="$(oc get proxy/cluster -o jsonpath={.spec.httpsProxy})"
825+
CLUSTER_NO_PROXY="$(oc get proxy/cluster -o jsonpath={.spec.noProxy})"
818826

819827
# If ADD_IMAGE_PULL_SECRET is true, then add additional cluster-wide image pull secret
820828
if [ "$ADD_IMAGE_PULL_SECRET" = true ]; then
@@ -880,7 +888,7 @@ wait_for_runtimeclass kata || exit 1
880888
create_runtimeclasses "$TEE_TYPE" || exit 1
881889

882890
# set the aa_kbc_params config for the kata agent to be used CoCo attestation
883-
set_kernel_params_for_kata_agent "$TEE_TYPE" "$TRUSTEE_URL" || exit 1
891+
set_kernel_params_for_kata_agent "$TEE_TYPE" "$TRUSTEE_URL" "$CLUSTER_HTTPS_PROXY" "$CLUSTER_NO_PROXY" || exit 1
884892

885893
# If single node OpenShift, then wait for the master MCP to be ready
886894
# Else wait for kata-oc MCP to be ready

0 commit comments

Comments
 (0)