8000 🐛 Fix Kind E2E dependency bootstrap by abahmed · Pull Request #514 · abahmed/kwatch · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion scripts/check-e2e-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
patterns='KWATCH_E2E_CANARY_|client-certificate-data:|client-key-data:|'
patterns="${patterns}Bearer [^[]|Basic [^[]|diagnostics-token|kind: Secret|"
patterns="${patterns}password[=:][^[]|api[_-]*key[=:][^[]"
if rg -n -i --hidden --glob '!*.png' "$patterns" "$artifacts";
if grep -RIqiE --exclude='*.png' "$patterns" "$artifacts";
then
echo "unsafe content found in E2E artifacts" >&2
exit 1
Expand Down
15 changes: 9 additions & 6 deletions scripts/test-kind-scenarios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ EOF
kind export logs "$ARTIFACTS/kind-logs" \
--name "$KIND_CLUSTER_NAME" >/dev/null 2>&1 || true
if ! "$harness_root/scripts/check-e2e-artifacts.sh" "$ARTIFACTS"; then
find "$ARTIFACTS" -type f -exec rm -f {} +
printf '%s\n' 'artifact safety check failed' \
>"$ARTIFACTS/artifact-safety-failed.txt"
fi
Expand All @@ -145,7 +146,7 @@ capture_http_diagnostics() {
return
fi
printf '%s\n' "$leader_pod" >"$ARTIFACTS/kwatch/leader.txt"
kubectl -n kwatch port-forward "pod/$leader_pod" 18081:8080 \
kubectl -n kwatch port-forward "pod/$leader_pod" 18081:8060 \
>"$ARTIFACTS/kwatch/port-forward.log" 2>&1 &
kwatch_forward=$!
wait_for_http http://127.0.0.1:18081/healthz || true
Expand All @@ -163,11 +164,11 @@ find_kwatch_leader() {
for pod in $(kubectl -n kwatch get pods -l app=kwatch \
-o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' \
2>/dev/null || true); do
kubectl -n kwatch port-forward "pod/$pod" "$port:8080" \
kubectl -n kwatch port-forward "pod/$pod" "$port:8060" \
>/dev/null 2>&1 &
forward=$!
if wait_for_http "http://127.0.0.1:$port/availabilityz" &&
curl -fsS "http://127.0.0.1:$port/availabilityz" \
if wait_for_http "http://127.0.0.1:$port/readyz" &&
curl -fsS "http://127.0.0.1:$port/readyz" \
>/dev/null 2>&1; then
leader_pod=$pod
kill "$forward" >/dev/null 2>&1 || true
Expand Down Expand Up @@ -275,9 +276,11 @@ if [ "$metrics_checksum" != "$METRICS_SERVER_MANIFEST_SHA256" ]; then
exit 1
fi
kubectl apply -f "$metrics_manifest"
metrics_patch='[{"op":"add","path":'
metrics_patch="${metrics_patch}\"/spec/template/spec/containers/0/args/-\","
metrics_patch="${metrics_patch}\"value\":\"--kubelet-insecure-tls\"}]"
kubectl -n kube-system patch deployment metrics-server --type=json \
-p='[{"op":"add","path":"/spec/template/spec/containers/0/args/-",\
"value":"--kubelet-insecure-tls"}]'
-p "$metrics_patch"
kubectl -n kube-system rollout status deployment/metrics-server \
--timeout=5m
kubectl wait --for=condition=Available \
Expand Down
Loading
0