Merge pull request #76859 from SataQiu/fix-kubeadm-20190420

kubeadm: use 'errors.Errorf' instead of 'fmt.Errorf'
This commit is contained in:
Kubernetes Prow Robot 2019-04-20 14:21:44 -07:00 committed by GitHub
commit c0c1e148e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -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",
],
)

View File

@ -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)