mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
- Ensure k3s mode uses the k3s registry endpoint and avoid localhost/k3d image prefixes. - Make ArgoCD repo-server cmp symlink creation idempotent. - Normalize common-core provisioning to knoe-system and add repair-time dedupe of stray default-namespace installs. - Add k3s MariaDB datastore/refresh playbooks and regression tests.
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
import re
|
|
from pathlib import Path
|
|
|
|
|
|
def test_argocd_repo_server_copyutil_symlink_is_idempotent():
|
|
manifest_path = Path(__file__).resolve().parents[1] / "k8s" / "argocd" / "install.yaml"
|
|
text = manifest_path.read_text(encoding="utf-8")
|
|
|
|
# Ensure the repo-server initContainer makes the cmp-server symlink idempotently.
|
|
# The repo-server can be recreated while `/var/run/argocd` is persisted (hostPath),
|
|
# so an unconditional `ln -s` will fail with "File exists".
|
|
assert "argocd-cmp-server" in text
|
|
|
|
safe_link_re = re.compile(
|
|
r"/bin/ln\s+-sf\s+/var/run/argocd/argocd\s+/var/run/argocd/argocd-cmp-server",
|
|
re.MULTILINE,
|
|
)
|
|
assert safe_link_re.search(text), (
|
|
"Expected ArgoCD repo-server copyutil initContainer to use `ln -sf` when creating "
|
|
"`/var/run/argocd/argocd-cmp-server`."
|
|
)
|
|
|
|
unsafe_link_re = re.compile(
|
|
r"/bin/ln\s+-s\s+/var/run/argocd/argocd\s+/var/run/argocd/argocd-cmp-server",
|
|
re.MULTILINE,
|
|
)
|
|
assert not unsafe_link_re.search(text), (
|
|
"Found an unconditional `ln -s` for `argocd-cmp-server` which is not idempotent."
|
|
)
|