diff --git a/cluster/addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml b/cluster/addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml index 474ddf7c5c5..9b7fdf1e172 100644 --- a/cluster/addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml +++ b/cluster/addons/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml @@ -10,4 +10,4 @@ spec: dnsPolicy: Default containers: - name: etcd-empty-dir-cleanup - image: gcr.io/google_containers/etcd-empty-dir-cleanup:0.0.1 + image: gcr.io/google-containers/etcd-empty-dir-cleanup:3.0.14.0 diff --git a/cluster/images/etcd-empty-dir-cleanup/Dockerfile b/cluster/images/etcd-empty-dir-cleanup/Dockerfile index 3798a559ee8..4eb59960214 100644 --- a/cluster/images/etcd-empty-dir-cleanup/Dockerfile +++ b/cluster/images/etcd-empty-dir-cleanup/Dockerfile @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM gliderlabs/alpine +FROM busybox + +COPY etcdctl etcd-empty-dir-cleanup.sh / +RUN chmod a+rx /etcdctl /etcd-empty-dir-cleanup.sh -RUN apk-install bash -ADD etcd-empty-dir-cleanup.sh etcd-empty-dir-cleanup.sh -ADD etcdctl etcdctl ENV ETCDCTL /etcdctl ENV SLEEP_SECOND 3600 -RUN chmod +x etcd-empty-dir-cleanup.sh -CMD bash /etcd-empty-dir-cleanup.sh + +USER nobody:nogroup + +ENTRYPOINT ["/etcd-empty-dir-cleanup.sh"] diff --git a/cluster/images/etcd-empty-dir-cleanup/Makefile b/cluster/images/etcd-empty-dir-cleanup/Makefile index 30aa2010763..d84a353ce00 100644 --- a/cluster/images/etcd-empty-dir-cleanup/Makefile +++ b/cluster/images/etcd-empty-dir-cleanup/Makefile @@ -14,9 +14,9 @@ .PHONY: build push -ETCD_VERSION = 2.2.1 -IMAGE = gcr.io/google_containers/etcd-empty-dir-cleanup -TAG = 0.0.1 +ETCD_VERSION = 3.0.14 +IMAGE = gcr.io/google-containers/etcd-empty-dir-cleanup +TAG = 3.0.14.0 clean: rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz diff --git a/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh b/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh index cb0eb3109b4..e714cabf4ca 100644 --- a/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh +++ b/cluster/images/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Copyright 2016 The Kubernetes Authors. # @@ -17,7 +17,7 @@ echo "Removing empty directories from etcd..." cleanup_empty_dirs () { - if [[ $(${ETCDCTL} ls $1) ]]; then + if [ "$(${ETCDCTL} ls $1)" ]; then for SUBDIR in $(${ETCDCTL} ls -p $1 | grep "/$") do cleanup_empty_dirs ${SUBDIR} @@ -34,4 +34,4 @@ do cleanup_empty_dirs "/registry" echo "Done with cleanup." sleep ${SLEEP_SECOND} -done \ No newline at end of file +done