Merge pull request #51004 from zhouhaibing089/rsync-fix

Automatic merge from submit-queue (batch tested with PRs 51666, 49829, 51058, 51004, 50938)

add the caller ip into rsync hosts allow list

fixes https://github.com/kubernetes/kubernetes/issues/51003.

This patch allows running build in pods.

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-09-02 22:52:08 -07:00 committed by GitHub
commit a244a55c96
2 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,7 @@ port = 8730
numeric ids = true
$USER_CONFIG
hosts deny = *
hosts allow = ${ALLOW}
hosts allow = ${ALLOW} ${ALLOW_HOST-}
auth users = k8s
secrets file = ${SECRETS}
read only = false

View File

@ -617,6 +617,7 @@ function kube::build::start_rsyncd_container() {
V=3 kube::log::status "Starting rsyncd container"
kube::build::run_build_command_ex \
"${KUBE_RSYNC_CONTAINER_NAME}" -p 127.0.0.1:${KUBE_RSYNC_PORT}:${KUBE_CONTAINER_RSYNC_PORT} -d \
-e ALLOW_HOST="$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')" \
-- /rsyncd.sh >/dev/null
local mapped_port