diff --git a/docker-compose.yml b/docker-compose.yml index ebdd979..c78eded 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,7 +78,13 @@ services: # LocalStack for S3 emulation localstack: - image: localstack/localstack:3.0 + # 4.14.0, not 3.0: 3.0 is 3.0.2 on Debian 12 (glibc 2.36), whose setenv + # frees the environ array it outgrows while another thread's getenv may + # still read it. LocalStack adds its AWS credentials to the environment + # at startup while its analytics thread is in getaddrinfo, and about one + # start in 2000 dies of SIGSEGV (exit 245). 4.14.0 is Debian 13 (glibc + # 2.41, which keeps the old array) and starts without an auth token. + image: localstack/localstack:4.14.0 container_name: orderflow-localstack ports: - "4566:4566" diff --git a/orderflow-k8s/base/localstack/deployment.yaml b/orderflow-k8s/base/localstack/deployment.yaml index c3c4ec9..18f52a5 100644 --- a/orderflow-k8s/base/localstack/deployment.yaml +++ b/orderflow-k8s/base/localstack/deployment.yaml @@ -45,12 +45,13 @@ spec: app: localstack spec: # ── Mac ARM64 (Apple Silicon) ────────────────────────────────────────── - # localstack/localstack:3.0 ships a native linux/arm64 layer. + # localstack/localstack:4.14.0 ships a native linux/arm64 layer. It is + # the compose file's LocalStack (see the reason there). nodeSelector: kubernetes.io/arch: arm64 containers: - name: localstack - image: localstack/localstack:3.0 + image: localstack/localstack:4.14.0 ports: - containerPort: 4566 env: @@ -61,8 +62,13 @@ spec: - name: AWS_DEFAULT_REGION value: "us-east-1" volumeMounts: + # The hook alone (subPath), not the whole ConfigMap volume: + # LocalStack 4.x runs every script under ready.d, its + # subdirectories too, so it would also run the copy in the + # volume's hidden timestamped directory, and run the hook twice. - name: localstack-init - mountPath: /etc/localstack/init/ready.d + mountPath: /etc/localstack/init/ready.d/init.sh + subPath: init.sh - name: localstack-data mountPath: /var/lib/localstack readinessProbe: diff --git a/producer/handlers/order.go b/producer/handlers/order.go index 1fd8ca9..c32612a 100644 --- a/producer/handlers/order.go +++ b/producer/handlers/order.go @@ -94,7 +94,7 @@ func (h *OrderHandler) CreateOrder(w http.ResponseWriter, r *http.Request) { log.Printf("Kafka event published for order %s", order.ID) } - order.Status = "created" + order.Status = "order created" w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusCreated) json.NewEncoder(w).Encode(map[string]interface{}{