Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/e2e/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,21 @@ deploy_central() {
DEPLOY_DIR="deploy/${ORCHESTRATOR_FLAVOR}"
CENTRAL_NAMESPACE="${central_namespace}" "${ROOT}/${DEPLOY_DIR}/central.sh"
fi

if [[ -n "${IS_RACE_BUILD:-}" ]]; then
# The busybox-style consolidated binary (ROX-33958) runs init() for all
# components at startup. Under the race detector's ~5-10x memory multiplier
# this causes OOMKills for components with tight memory limits.
if [[ "${DEPLOY_STACKROX_VIA_OPERATOR}" == "true" ]]; then
# Operator reconciles away kubectl overrides, so patch the CR instead.
info "Race build detected: patching Central CR to increase config-controller memory"
retrying_kubectl </dev/null -n "${central_namespace}" patch central stackrox-central-services --type=merge \
-p '{"spec":{"configAsCode":{"resources":{"limits":{"memory":"512Mi"}}}}}'
else
info "Race build detected: increasing memory limits for config-controller"
retrying_kubectl </dev/null -n "${central_namespace}" set resources deploy/config-controller -c manager --limits 'memory=512Mi'
fi
fi
}

# shellcheck disable=SC2120
Expand Down Expand Up @@ -425,6 +440,20 @@ deploy_sensor() {
# et al.
retrying_kubectl </dev/null -n "${sensor_namespace}" set resources deploy/sensor -c sensor --requests 'cpu=2' --limits 'cpu=4'
fi

if [[ -n "${IS_RACE_BUILD:-}" ]]; then
# The busybox-style consolidated binary (ROX-33958) runs init() for all
# components at startup. Under the race detector's ~5-10x memory multiplier
# this causes OOMKills for components with tight memory limits.
if [[ "${DEPLOY_STACKROX_VIA_OPERATOR}" == "true" ]]; then
info "Race build detected: patching SecuredCluster CR to increase admission-control memory"
retrying_kubectl </dev/null -n "${sensor_namespace}" patch securedcluster stackrox-secured-cluster-services --type=merge \
-p '{"spec":{"admissionControl":{"resources":{"limits":{"memory":"2Gi"}}}}}'
else
info "Race build detected: increasing memory limits for admission-control"
retrying_kubectl </dev/null -n "${sensor_namespace}" set resources deploy/admission-control -c admission-control --limits 'memory=2Gi'
fi
fi
}

# shellcheck disable=SC2120
Expand Down
Loading