From a536ebc580f5737b5dcfb1a087ceaaa791af26c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20H=C3=B6rl?= Date: Sun, 24 Jun 2018 11:15:13 +0100 Subject: [PATCH] Remove unused exported errors --- pkg/cloudprovider/providers/vsphere/vclib/connection.go | 6 ------ .../providers/vsphere/vclib/connection_test.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/cloudprovider/providers/vsphere/vclib/connection.go b/pkg/cloudprovider/providers/vsphere/vclib/connection.go index af56069c94b..63d2cdbdff1 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/connection.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/connection.go @@ -20,7 +20,6 @@ import ( "context" "crypto/tls" "encoding/pem" - "errors" "net" neturl "net/url" "sync" @@ -148,11 +147,6 @@ func (connection *VSphereConnection) Logout(ctx context.Context) { } } -var ( - ErrCaCertNotReadable = errors.New("Could not read CA cert file") - ErrCaCertInvalid = errors.New("Could not parse CA cert file") -) - // NewClient creates a new govmomi client for the VSphereConnection obj func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Client, error) { url, err := soap.ParseURL(net.JoinHostPort(connection.Hostname, connection.Port)) diff --git a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go index 14fd22d8413..b5569d92ae1 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go @@ -180,8 +180,8 @@ func TestInvalidCaCert(t *testing.T) { _, err := connection.NewClient(context.Background()) - if err != vclib.ErrCaCertInvalid { - t.Fatalf("ErrCaCertInvalid should have occurred, instead got: %v", err) + if msg := err.Error(); !strings.Contains(msg, "invalid certificate") { + t.Fatalf("Expected invalid certificate error, got '%s'", msg) } }