diff --git a/build/common.sh b/build/common.sh index 80c6fc7d8a3..2db1fae3226 100755 --- a/build/common.sh +++ b/build/common.sh @@ -654,7 +654,6 @@ function kube::build::stop_rsyncd_container() { function kube::build::rsync { local -a rsync_opts=( --archive - --prune-empty-dirs --password-file="${LOCAL_OUTPUT_BUILD_CONTEXT}/rsyncd.password" ) if (( ${KUBE_VERBOSE} >= 6 )); then @@ -679,16 +678,19 @@ function kube::build::sync_to_container() { # directory and generated files. The '- /' filter prevents rsync # from trying to set the uid/gid/perms on the root of the sync tree. # As an exception, we need to sync generated files in staging/, because - # they will not be re-generated by 'make'. + # they will not be re-generated by 'make'. Note that the 'H' filtered files + # are hidden from rsync so they will be deleted in the target container if + # they exist. This will allow them to be re-created in the container if + # necessary. kube::build::rsync \ --delete \ - --filter='- /.git/' \ + --filter='H /.git/' \ --filter='- /.make/' \ --filter='- /_tmp/' \ --filter='- /_output/' \ --filter='- /' \ - --filter='- zz_generated.*' \ - --filter='- generated.proto' \ + --filter='H zz_generated.*' \ + --filter='H generated.proto' \ "${KUBE_ROOT}/" "rsync://k8s@${KUBE_RSYNC_ADDR}/k8s/" kube::build::stop_rsyncd_container @@ -714,6 +716,7 @@ function kube::build::copy_output() { # We are looking to copy out all of the built binaries along with various # generated files. kube::build::rsync \ + --prune-empty-dirs \ --filter='- /_temp/' \ --filter='+ /vendor/' \ --filter='+ /Godeps/' \