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
89dd2b28
Commit
89dd2b28
authored
May 31, 2018
by
hangaoshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused code in kubeadm error.go
parent
15cd3552
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
error.go
cmd/kubeadm/app/util/error.go
+3
-7
error_test.go
cmd/kubeadm/app/util/error_test.go
+1
-1
No files found.
cmd/kubeadm/app/util/error.go
View file @
89dd2b28
...
...
@@ -33,10 +33,6 @@ const (
ValidationExitCode
=
3
)
type
debugError
interface
{
DebugError
()
(
msg
string
,
args
[]
interface
{})
}
// fatal prints the message if set and then exits.
func
fatal
(
msg
string
,
code
int
)
{
if
len
(
msg
)
>
0
{
...
...
@@ -56,7 +52,7 @@ func fatal(msg string, code int) {
// This method is generic to the command in use and may be used by non-Kubectl
// commands.
func
CheckErr
(
err
error
)
{
checkErr
(
""
,
err
,
fatal
)
checkErr
(
err
,
fatal
)
}
// preflightError allows us to know if the error is a preflight error or not
...
...
@@ -66,8 +62,8 @@ type preflightError interface {
}
// checkErr formats a given error as a string and calls the passed handleErr
// func with that string and an
kubectl
exit code.
func
checkErr
(
prefix
string
,
err
error
,
handleErr
func
(
string
,
int
))
{
// func with that string and an exit code.
func
checkErr
(
err
error
,
handleErr
func
(
string
,
int
))
{
switch
err
.
(
type
)
{
case
nil
:
return
...
...
cmd/kubeadm/app/util/error_test.go
View file @
89dd2b28
...
...
@@ -42,7 +42,7 @@ func TestCheckErr(t *testing.T) {
for
_
,
rt
:=
range
tokenTest
{
codeReturned
=
0
checkErr
(
""
,
rt
.
e
,
errHandle
)
checkErr
(
rt
.
e
,
errHandle
)
if
codeReturned
!=
rt
.
expected
{
t
.
Errorf
(
"failed checkErr:
\n\t
expected: %d
\n\t
actual: %d"
,
...
...
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