mirror of https://github.com/k3s-io/k3s
Merge pull request #64543 from hanxiaoshuai/fix05311
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. remove unused code in kubeadm error.go **What this PR does / why we need it**: remove unused code in kubeadm error.go **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
bb869d8389
|
@ -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
|
||||
|
|
|
@ -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\texpected: %d\n\t actual: %d",
|
||||
|
|
Loading…
Reference in New Issue