diff --git a/Makefile b/Makefile index 36249aa..c84b45c 100644 --- a/Makefile +++ b/Makefile @@ -1065,7 +1065,11 @@ k8s: docker rm -f $$CONTAINER_NAME 2>/dev/null || true; \ echo "🗑️ Удаление контейнеров из пресета..."; \ if [ -f "molecule/presets/k8s/$$PRESET.yml" ]; then \ - python3 scripts/delete_hosts.py molecule/presets/k8s/$$PRESET.yml 2>/dev/null || true; \ + if docker ps | grep -q $$CONTAINER_NAME; then \ + docker exec $$CONTAINER_NAME bash -c "python3 /workspace/scripts/delete_hosts.py /workspace/molecule/presets/k8s/$$PRESET.yml" 2>/dev/null || true; \ + else \ + python3 scripts/delete_hosts.py molecule/presets/k8s/$$PRESET.yml 2>/dev/null || true; \ + fi; \ fi; \ echo "✅ Удаление завершено";; \ stop) \