Skip to content

Commit c0c1e14

Browse files
authored
Merge pull request kubernetes#76859 from SataQiu/fix-kubeadm-20190420
kubeadm: use 'errors.Errorf' instead of 'fmt.Errorf'
2 parents c262f9c + 62dbd0f commit c0c1e14

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cmd/kubeadm/app/discovery/token/BUILD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ go_test(
4545
name = "go_default_test",
4646
srcs = ["token_test.go"],
4747
embed = [":go_default_library"],
48-
deps = ["//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library"],
48+
deps = [
49+
"//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library",
50+
"//vendor/github.com/pkg/errors:go_default_library",
51+
],
4952
)

cmd/kubeadm/app/discovery/token/token_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ limitations under the License.
1717
package token
1818

1919
import (
20-
"fmt"
2120
"testing"
2221
"time"
2322

23+
"github.com/pkg/errors"
24+
2425
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
2526
)
2627

@@ -71,7 +72,7 @@ func TestFetchKubeConfigWithTimeout(t *testing.T) {
7172
t.Run(test.name, func(t *testing.T) {
7273
cfg, err := fetchKubeConfigWithTimeout(testAPIEndpoint, test.discoveryTimeout, func(apiEndpoint string) (*clientcmdapi.Config, error) {
7374
if apiEndpoint != testAPIEndpoint {
74-
return nil, fmt.Errorf("unexpected API server endpoint:\n\texpected: %q\n\tgot: %q", testAPIEndpoint, apiEndpoint)
75+
return nil, errors.Errorf("unexpected API server endpoint:\n\texpected: %q\n\tgot: %q", testAPIEndpoint, apiEndpoint)
7576
}
7677

7778
time.Sleep(3 * time.Second)

0 commit comments

Comments
 (0)