Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kube-bench
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
aquasecurity
kube-bench
Commits
f5550fd8
You need to sign in or sign up before continuing.
Commit
f5550fd8
authored
7 years ago
by
Liz Rice
Browse files
Options
Downloads
Patches
Plain Diff
Node type is now verified by looking for running binaries from a set of options
parent
0e9c11eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/common.go
+0
-36
0 additions, 36 deletions
cmd/common.go
with
0 additions
and
36 deletions
cmd/common.go
+
0
−
36
View file @
f5550fd8
...
@@ -74,7 +74,6 @@ func runChecks(t check.NodeType) {
...
@@ -74,7 +74,6 @@ func runChecks(t check.NodeType) {
// Run kubernetes installation validation checks.
// Run kubernetes installation validation checks.
verifyKubeVersion
(
kubeMajorVersion
,
kubeMinorVersion
)
verifyKubeVersion
(
kubeMajorVersion
,
kubeMinorVersion
)
verifyNodeType
(
t
)
switch
t
{
switch
t
{
case
check
.
MASTER
:
case
check
.
MASTER
:
...
@@ -126,41 +125,6 @@ func runChecks(t check.NodeType) {
...
@@ -126,41 +125,6 @@ func runChecks(t check.NodeType) {
}
}
}
}
// verifyNodeType checks the executables and config files are as expected
// for the specified tests (master, node or federated).
func
verifyNodeType
(
t
check
.
NodeType
)
{
var
bins
[]
string
var
confs
[]
string
switch
t
{
case
check
.
MASTER
:
bins
=
[]
string
{
apiserverBin
,
schedulerBin
,
controllerManagerBin
}
confs
=
[]
string
{
apiserverConf
,
schedulerConf
,
controllerManagerConf
}
case
check
.
NODE
:
bins
=
[]
string
{
kubeletBin
,
proxyBin
}
confs
=
[]
string
{
kubeletConf
,
proxyConf
}
case
check
.
FEDERATED
:
bins
=
[]
string
{
fedApiserverBin
,
fedControllerManagerBin
}
}
for
_
,
bin
:=
range
bins
{
if
!
verifyBin
(
bin
)
{
printlnWarn
(
fmt
.
Sprintf
(
"%s is not running"
,
bin
))
}
}
for
_
,
conf
:=
range
confs
{
_
,
err
:=
os
.
Stat
(
conf
)
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
printlnWarn
(
fmt
.
Sprintf
(
"Missing kubernetes config file: %s"
,
conf
))
}
else
{
exitWithError
(
fmt
.
Errorf
(
"error looking for file %s: %v"
,
conf
,
err
))
}
}
}
}
// colorPrint outputs the state in a specific colour, along with a message string
// colorPrint outputs the state in a specific colour, along with a message string
func
colorPrint
(
state
check
.
State
,
s
string
)
{
func
colorPrint
(
state
check
.
State
,
s
string
)
{
colors
[
state
]
.
Printf
(
"[%s] "
,
state
)
colors
[
state
]
.
Printf
(
"[%s] "
,
state
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment