GCI:Trusty: Fix an issue in using 'find' commands

This commit is contained in:
Andy Zheng 2016-05-16 17:48:29 -07:00
parent a6812d18a5
commit f8739cd0c2
2 changed files with 5 additions and 5 deletions

View File

@ -561,15 +561,15 @@ setup_addon_manifests() {
if [ ! -d "${dst_dir}" ]; then
mkdir -p "${dst_dir}"
fi
files=$(find "${src_dir}" -name "*.yaml")
files=$(find "${src_dir}" -maxdepth 1 -name "*.yaml")
if [ -n "${files}" ]; then
cp "${src_dir}/"*.yaml "${dst_dir}"
fi
files=$(find "${src_dir}" -name "*.json")
files=$(find "${src_dir}" -maxdepth 1 -name "*.json")
if [ -n "${files}" ]; then
cp "${src_dir}/"*.json "${dst_dir}"
fi
files=$(find "${src_dir}" -name "*.yaml.in")
files=$(find "${src_dir}" -maxdepth 1 -name "*.yaml.in")
if [ -n "${files}" ]; then
cp "${src_dir}/"*.yaml.in "${dst_dir}"
fi

View File

@ -152,9 +152,9 @@ install_kube_binary_config() {
tar xzf "${kube_home}/${manifests_tar}" -C "${dst_dir}" --overwrite
readonly kube_addon_registry="${KUBE_ADDON_REGISTRY:-gcr.io/google_containers}"
if [ "${kube_addon_registry}" != "gcr.io/google_containers" ]; then
find "${dst_dir}" -name \*.yaml -or -name \*.yaml.in | \
find "${dst_dir}" -maxdepth 1 -name \*.yaml -or -maxdepth 1 -name \*.yaml.in | \
xargs sed -ri "s@(image:\s.*)gcr.io/google_containers@\1${kube_addon_registry}@"
find "${dst_dir}" -name \*.manifest -or -name \*.json | \
find "${dst_dir}" -maxdepth 1 -name \*.manifest -or -maxdepth 1 -name \*.json | \
xargs sed -ri "s@(image\":\s+\")gcr.io/google_containers@\1${kube_addon_registry}@"
fi
cp "${dst_dir}/kubernetes/gci-trusty/configure-helper.sh" /etc/kube-configure-helper.sh