Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b8fd023f
Unverified
Commit
b8fd023f
authored
Mar 13, 2020
by
Erik Wilson
Committed by
GitHub
Mar 13, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1453 from ibuildthecloud/selinux-install
Don't require selinux utils and require k3s_selinux
parents
65f7fbe5
5753dbd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
install.sh
install.sh
+3
-17
No files found.
install.sh
View file @
b8fd023f
...
@@ -279,15 +279,6 @@ verify_downloader() {
...
@@ -279,15 +279,6 @@ verify_downloader() {
return
0
return
0
}
}
# --- verify existence of semanage when SELinux is enabled ---
verify_semanage
()
{
if
[
-x
"
$(
which getenforce
)
"
]
;
then
if
[
"Disabled"
!=
$(
getenforce
)
]
&&
[
!
-x
"
$(
which semanage
)
"
]
;
then
fatal
'SELinux is enabled but semanage is not found'
fi
fi
}
# --- create tempory directory and cleanup when done ---
# --- create tempory directory and cleanup when done ---
setup_tmp
()
{
setup_tmp
()
{
TMP_DIR
=
$(
mktemp
-d
-t
k3s-install.XXXXXXXXXX
)
TMP_DIR
=
$(
mktemp
-d
-t
k3s-install.XXXXXXXXXX
)
...
@@ -399,13 +390,9 @@ setup_binary() {
...
@@ -399,13 +390,9 @@ setup_binary() {
$SUDO
chown
root:root
${
TMP_BIN
}
$SUDO
chown
root:root
${
TMP_BIN
}
$SUDO
mv
-f
${
TMP_BIN
}
${
BIN_DIR
}
/k3s
$SUDO
mv
-f
${
TMP_BIN
}
${
BIN_DIR
}
/k3s
if
command
-v
getenforce
>
/dev/null 2>&1
;
then
if
!
$SUDO
chcon
-u
system_u
-r
object_r
-t
container_runtime_exec_t
${
BIN_DIR
}
/k3s 2>/dev/null 2>&1
;
then
if
[
"Disabled"
!=
$(
getenforce
)
]
;
then
if
$SUDO
grep
SELINUX
=
enforcing /etc/selinux/config
>
/dev/null 2>&1
;
then
info
'SELinux is enabled, setting permissions'
fatal
"Failed to apply container_runtime_exec_t to
${
BIN_DIR
}
/k3s, please install k3s-selinux RPM"
if
!
$SUDO
semanage fcontext
-l
|
grep
"
${
BIN_DIR
}
/k3s"
>
/dev/null 2>&1
;
then
$SUDO
semanage fcontext
-a
-t
bin_t
"
${
BIN_DIR
}
/k3s"
fi
$SUDO
restorecon
-v
${
BIN_DIR
}
/k3s
>
/dev/null
fi
fi
fi
fi
}
}
...
@@ -420,7 +407,6 @@ download_and_verify() {
...
@@ -420,7 +407,6 @@ download_and_verify() {
setup_verify_arch
setup_verify_arch
verify_downloader curl
||
verify_downloader wget
||
fatal
'Can not find curl or wget for downloading files'
verify_downloader curl
||
verify_downloader wget
||
fatal
'Can not find curl or wget for downloading files'
verify_semanage
setup_tmp
setup_tmp
get_release_version
get_release_version
download_hash
download_hash
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment