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
8fef7221
Commit
8fef7221
authored
Feb 22, 2019
by
PingWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup and refactoring
Signed-off-by:
PingWang
<
wang.ping5@zte.com.cn
>
parent
d9f3e967
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
checks.go
cmd/kubeadm/app/preflight/checks.go
+5
-11
No files found.
cmd/kubeadm/app/preflight/checks.go
View file @
8fef7221
...
...
@@ -1070,7 +1070,7 @@ func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String
Name
string
Errors
[]
error
}
found
:=
[]
checkErrors
{}
var
errsBuffer
bytes
.
Buffer
for
_
,
c
:=
range
checks
{
name
:=
c
.
Name
()
...
...
@@ -1085,18 +1085,12 @@ func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String
for
_
,
w
:=
range
warnings
{
io
.
WriteString
(
ww
,
fmt
.
Sprintf
(
"
\t
[WARNING %s]: %v
\n
"
,
name
,
w
))
}
if
len
(
errs
)
>
0
{
found
=
append
(
found
,
checkErrors
{
Name
:
name
,
Errors
:
errs
}
)
for
_
,
i
:=
range
errs
{
errsBuffer
.
WriteString
(
fmt
.
Sprintf
(
"
\t
[ERROR %s]: %v
\n
"
,
name
,
i
.
Error
())
)
}
}
if
len
(
found
)
>
0
{
var
errs
bytes
.
Buffer
for
_
,
c
:=
range
found
{
for
_
,
i
:=
range
c
.
Errors
{
errs
.
WriteString
(
fmt
.
Sprintf
(
"
\t
[ERROR %s]: %v
\n
"
,
c
.
Name
,
i
.
Error
()))
}
}
return
&
Error
{
Msg
:
errs
.
String
()}
if
errsBuffer
.
Len
()
>
0
{
return
&
Error
{
Msg
:
errsBuffer
.
String
()}
}
return
nil
}
...
...
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