Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

chore: sync origin/dev (74012bc6) into NP-08 branch

Alfredo Lopezc67877b2a651
diff --cc scripts/minikube/t2-common.sh
index 3ee087f4e,ecf791eae..fa13d1541
--- a/scripts/minikube/t2-common.sh
+++ b/scripts/minikube/t2-common.sh
@@@ -330,13 -337,8 +337,13 @@@ if source == "local"
print(source + "\t" + tag)
PY
)"; then
+ if [ "$T2_BOOTSTRAP_REQUIRED" = true ]; then
+ T2_PLAN_STATE=full-bootstrap
+ T2_PLAN_REASON='image manifest is invalid or has no source/tag; bootstrap will replace it'
+ return 0
+ fi
T2_NEXT_COMMAND="MINIKUBE_PROFILE=$T2_PROFILE make minikube-setup-local"
- t2_fail IMAGE_MANIFEST_MISMATCH 'image manifest is invalid or has no source/tag'
+ t2_fail IMAGE_MANIFEST_MISMATCH 'image manifest is invalid or incomplete for its image source'
fi
local manifest_source manifest_tag
IFS=$'\t' read -r manifest_source manifest_tag <<< "$manifest_values"
diff --cc scripts/tests/test-minikube-t2-scenarios.sh
index c778c38c2,deb366c58..1f16dd509
--- a/scripts/tests/test-minikube-t2-scenarios.sh
+++ b/scripts/tests/test-minikube-t2-scenarios.sh
@@@ -133,17 -142,44 +142,50 @@@ expect_code IMAGE_MANIFEST_MISMATCH sta
env "${repo_env[@]}" T2_IMAGE_MANIFEST="$manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG=old \
bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=old; t2_image_check' bash "$COMMON"
+invalid_manifest="$tmp/invalid-image-manifest.json"
+printf '{"imageSource":"ghcr","imageTag":""}\n' >"$invalid_manifest"
+bootstrap_manifest_state="$(env "${repo_env[@]}" T2_IMAGE_MANIFEST="$invalid_manifest" T2_BOOTSTRAP_REQUIRED=true \
+ bash -c 'source "$1"; T2_BOOTSTRAP_REQUIRED=true; t2_image_check; printf "%s" "$T2_PLAN_STATE"' bash "$COMMON")"
+[ "$bootstrap_manifest_state" = full-bootstrap ] || fail "invalid bootstrap manifest selected $bootstrap_manifest_state instead of full-bootstrap"
+
local_manifest="$tmp/local-image-manifest.json"
- printf '{"imageSource":"local","imageTag":""}\n' >"$local_manifest"
- local_manifest_state="$(env "${repo_env[@]}" T2_IMAGE_MANIFEST="$local_manifest" T2_BOOTSTRAP_REQUIRED=false \
- bash -c 'source "$1"; t2_image_check; printf "%s\t%s" "$T2_IMAGE_SOURCE" "$T2_IMAGE_TAG"' bash "$COMMON")"
- [ "$local_manifest_state" = $'local\t' ] || fail "local manifest with an empty tag was rejected: $local_manifest_state"
+ printf '{"imageSource":"local","imageTag":"","images":{"clerum/control-api:test":"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}}\n' >"$local_manifest"
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$local_manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
+
+ empty_local_manifest="$tmp/empty-local-image-manifest.json"
+ printf '{"imageSource":"local","imageTag":"","images":{}}\n' >"$empty_local_manifest"
+ expect_code IMAGE_MANIFEST_MISMATCH empty-local empty-local \
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$empty_local_manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
+
+ not_built_local_manifest="$tmp/not-built-local-image-manifest.json"
+ printf '{"imageSource":"local","imageTag":"","images":{"clerum/control-api:test":"NOT_BUILT"}}\n' >"$not_built_local_manifest"
+ expect_code IMAGE_MANIFEST_MISMATCH not-built-local not-built-local \
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$not_built_local_manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
+
+ # The multi-node writer records minikube_image_id output, which is NOT_FOUND
+ # when an image is absent from the node. Single-node records docker inspect's
+ # NOT_BUILT. Both sentinels must be rejected, so cover the multi-node one too.
+ not_found_local_manifest="$tmp/not-found-local-image-manifest.json"
+ printf '{"imageSource":"local","imageTag":"","images":{"clerum/control-api:test":"NOT_FOUND"}}
+ ' >"$not_found_local_manifest"
+ expect_code IMAGE_MANIFEST_MISMATCH not-found-local not-found-local \
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$not_found_local_manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
+
+ short_local_manifest="$tmp/short-local-image-manifest.json"
+ printf '{"imageSource":"local","imageTag":"","images":{"clerum/control-api:test":"sha256:0123456789abcdef0123456789abcdef"}}\n' >"$short_local_manifest"
+ expect_code IMAGE_MANIFEST_MISMATCH short-local short-local \
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$short_local_manifest" T2_IMAGE_SOURCE=local T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=local; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
+
+ ghcr_manifest="$tmp/ghcr-image-manifest.json"
+ printf '{"imageSource":"ghcr","imageTag":""}\n' >"$ghcr_manifest"
+ expect_code IMAGE_MANIFEST_MISMATCH tagless-ghcr tagless-ghcr \
+ env "${repo_env[@]}" T2_IMAGE_MANIFEST="$ghcr_manifest" T2_IMAGE_SOURCE=ghcr T2_IMAGE_TAG= \
+ bash -c 'source "$1"; T2_IMAGE_SOURCE=ghcr; T2_IMAGE_TAG=""; t2_image_check' bash "$COMMON"
expect_code SECRET_MISSING missing-secret missing-secret \
env "${repo_env[@]}" T2_BOOTSTRAP_REQUIRED=false T2_REQUIRED_NAMESPACES=control-plane \