diff --git a/cmd/kubeadm/app/discovery/token/BUILD b/cmd/kubeadm/app/discovery/token/BUILD index 75f4f3caffe..b6504aa44f1 100644 --- a/cmd/kubeadm/app/discovery/token/BUILD +++ b/cmd/kubeadm/app/discovery/token/BUILD @@ -45,5 +45,8 @@ go_test( name = "go_default_test", srcs = ["token_test.go"], embed = [":go_default_library"], - deps = ["//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library"], + deps = [ + "//staging/src/k8s.io/client-go/tools/clientcmd/api:go_default_library", + "//vendor/github.com/pkg/errors:go_default_library", + ], ) diff --git a/cmd/kubeadm/app/discovery/token/token_test.go b/cmd/kubeadm/app/discovery/token/token_test.go index 8be1147e0e1..7ef08aee3a2 100644 --- a/cmd/kubeadm/app/discovery/token/token_test.go +++ b/cmd/kubeadm/app/discovery/token/token_test.go @@ -17,10 +17,11 @@ limitations under the License. package token import ( - "fmt" "testing" "time" + "github.com/pkg/errors" + clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) @@ -71,7 +72,7 @@ func TestFetchKubeConfigWithTimeout(t *testing.T) { t.Run(test.name, func(t *testing.T) { cfg, err := fetchKubeConfigWithTimeout(testAPIEndpoint, test.discoveryTimeout, func(apiEndpoint string) (*clientcmdapi.Config, error) { if apiEndpoint != testAPIEndpoint { - return nil, fmt.Errorf("unexpected API server endpoint:\n\texpected: %q\n\tgot: %q", testAPIEndpoint, apiEndpoint) + return nil, errors.Errorf("unexpected API server endpoint:\n\texpected: %q\n\tgot: %q", testAPIEndpoint, apiEndpoint) } time.Sleep(3 * time.Second)