refactor: запуск Python скриптов через контейнер k8s
Some checks failed
Ansible Testing / lint (push) Has been cancelled
Ansible Testing / test (default) (push) Has been cancelled
Ansible Testing / test (minimal) (push) Has been cancelled
Ansible Testing / test (performance) (push) Has been cancelled
Ansible Testing / deploy-check (push) Has been cancelled
Some checks failed
Ansible Testing / lint (push) Has been cancelled
Ansible Testing / test (default) (push) Has been cancelled
Ansible Testing / test (minimal) (push) Has been cancelled
Ansible Testing / test (performance) (push) Has been cancelled
Ansible Testing / deploy-check (push) Has been cancelled
- Команда destroy теперь запускает delete_hosts.py через контейнер k8s - Все Python скрипты выполняются внутри Docker контейнера для единообразия - Если контейнер не запущен, скрипты выполняются на хосте (fallback)
This commit is contained in:
4
Makefile
4
Makefile
@@ -1065,8 +1065,12 @@ k8s:
|
|||||||
docker rm -f $$CONTAINER_NAME 2>/dev/null || true; \
|
docker rm -f $$CONTAINER_NAME 2>/dev/null || true; \
|
||||||
echo "🗑️ Удаление контейнеров из пресета..."; \
|
echo "🗑️ Удаление контейнеров из пресета..."; \
|
||||||
if [ -f "molecule/presets/k8s/$$PRESET.yml" ]; then \
|
if [ -f "molecule/presets/k8s/$$PRESET.yml" ]; then \
|
||||||
|
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; \
|
python3 scripts/delete_hosts.py molecule/presets/k8s/$$PRESET.yml 2>/dev/null || true; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
echo "✅ Удаление завершено";; \
|
echo "✅ Удаление завершено";; \
|
||||||
stop) \
|
stop) \
|
||||||
echo "🛑 Остановка Kind кластера..."; \
|
echo "🛑 Остановка Kind кластера..."; \
|
||||||
|
|||||||
Reference in New Issue
Block a user