The person that found this is a hero.
Whenever I see slightly weird behaviour, there is a temptation to just move on because there isn’t enough time, running software is complicated, and there is something else I want to do. I will try to change my attitude in future in case it uncovers a backdoor like this – it would be educational too.
I am not sure if it is best practice, but this is what I do and it might provide some inspiration:
This has the advantage that Gitops and normal git repositories are separate. I think that a similar principle would work with docker compose instead of k8s.