zuul-jobs/roles/mirror-workspace-git-repos
Benjamin Schanzel 5b66292c55 Multi Node/Context support for mirroring Git workspaces via kubectl
The mirroring of git workspaces to k8s pod nodes is done by piping a git
push command through `kubectl exec`. Without specifying a k8s context
for kubectl, the `current-context` from the kubeconfig is used. This is
problematic in multi-node scenarios where different nodes reside in
different namespaces and thus, are reachable via separate contexts.
Ansible cannot handle the context switch automatically as it would via
the inventory and its kubectl connection plugin because we are running
the git push from the executor/localhost.
This change makes sure the correct context of the corresponding node is
passed to `kubectl exec` explicitly, thus pushing the git repos to the
correct k8s pod.

Change-Id: Ic0b11b5860bb0062b3a1c068f4f963fb76018715
2020-08-17 15:48:14 +02:00
..
defaults Optionally silence git in mirror-workspace-git-repos 2019-02-14 08:52:38 +01:00
tasks Multi Node/Context support for mirroring Git workspaces via kubectl 2020-08-17 15:48:14 +02:00
README.rst Optionally silence git in mirror-workspace-git-repos 2019-02-14 08:52:38 +01:00

Mirror the local git repos to remote nodes

This role uses git operations (unlike :zuulprepare-workspace which uses rsync) to mirror the local prepared git repos to the remote nodes. This may be useful if the remote node already has a copy of some or all of the git repos.

Role Variables