Add safe_format_and_mount to hyperkube image.

* Add volume format script into hyperkube image.
* Fix issue with format script on non-redhat platforms.
This commit is contained in:
Chris Moos 2015-04-25 00:39:33 -07:00
parent 72048a824c
commit 1b814ffd2c
3 changed files with 12 additions and 7 deletions

View File

@ -8,3 +8,5 @@ RUN chmod a+rx /hyperkube
COPY master-multi.json /etc/kubernetes/manifests-multi/master.json
COPY master.json /etc/kubernetes/manifests/master.json
COPY safe_format_and_mount /usr/share/google/safe_format_and_mount
RUN chmod a+rx /usr/share/google/safe_format_and_mount

View File

@ -3,6 +3,7 @@
VERSION=v0.14.2
all:
cp ../../saltbase/salt/helpers/safe_format_and_mount .
curl -O https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/linux/amd64/hyperkube
docker build -t gcr.io/google_containers/hyperkube:${VERSION} .
gcloud preview docker push gcr.io/google_containers/hyperkube:${VERSION}

View File

@ -23,12 +23,14 @@
FSCK=fsck.ext4
MOUNT_OPTIONS="discard,defaults"
MKFS="mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 -F"
if grep -q '6\..' /etc/redhat-release; then
# lazy_journal_init is not recognized in redhat 6
MKFS="mkfs.ext4 -E lazy_itable_init=0 -F"
elif grep -q '7\..' /etc/redhat-release; then
FSCK=fsck.xfs
MKFS=mkfs.xfs
if [ -e /etc/redhat-release ]; then
if grep -q '6\..' /etc/redhat-release; then
# lazy_journal_init is not recognized in redhat 6
MKFS="mkfs.ext4 -E lazy_itable_init=0 -F"
elif grep -q '7\..' /etc/redhat-release; then
FSCK=fsck.xfs
MKFS=mkfs.xfs
fi
fi
LOGTAG=safe_format_and_mount
@ -142,4 +144,4 @@ function try_mount() {
}
try_mount
exit $?
exit $?