Merge pull request #23866 from intelsdi-x/chcon_invalid_argument_in_dockerized_kubelet

Automatic merge from submit-queue

invalid arg during applying SELinux label

Tested with Ubuntu 16.04 with SELINUX support. Actually, after `chcon `with long label got: `chcon: failed to set type security context component to ‘system_u:object_r:svirt_sandbox_file_t:s0’: Invalid argument`
This commit is contained in:
k8s-merge-robot 2016-06-30 20:39:31 -07:00 committed by GitHub
commit 1ab7671fdc

View File

@ -324,7 +324,7 @@ function start_kubelet {
which chcon > /dev/null ; then which chcon > /dev/null ; then
if [[ ! $(ls -Zd /var/lib/kubelet) =~ system_u:object_r:svirt_sandbox_file_t:s0 ]] ; then if [[ ! $(ls -Zd /var/lib/kubelet) =~ system_u:object_r:svirt_sandbox_file_t:s0 ]] ; then
echo "Applying SELinux label to /var/lib/kubelet directory." echo "Applying SELinux label to /var/lib/kubelet directory."
if ! chcon -R system_u:object_r:svirt_sandbox_file_t:s0 /var/lib/kubelet; then if ! sudo chcon -Rt svirt_sandbox_file_t /var/lib/kubelet; then
echo "Failed to apply selinux label to /var/lib/kubelet." echo "Failed to apply selinux label to /var/lib/kubelet."
fi fi
fi fi