From 795e4c42541cb3771c40a7ee82f6452e210a0ccc Mon Sep 17 00:00:00 2001 From: Maria Ntalla Date: Wed, 6 Jun 2018 13:12:56 +0100 Subject: [PATCH] Add godocs for fixtures ... and rename `InvalidCaCertPath` to `InvalidCertPath`. --- .../providers/vsphere/vclib/connection_test.go | 2 +- .../vsphere/vclib/fixtures/fixtures.go | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go index 93f9bc08c8e..1af398990a9 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/connection_test.go @@ -103,7 +103,7 @@ func TestInvalidCaCert(t *testing.T) { connection := &vclib.VSphereConnection{ Hostname: "should-not-matter", Port: "should-not-matter", - CACert: fixtures.InvalidCaCertPath, + CACert: fixtures.InvalidCertPath, } _, err := connection.NewClient(context.Background()) diff --git a/pkg/cloudprovider/providers/vsphere/vclib/fixtures/fixtures.go b/pkg/cloudprovider/providers/vsphere/vclib/fixtures/fixtures.go index a0838224bae..ebd64d58f9a 100644 --- a/pkg/cloudprovider/providers/vsphere/vclib/fixtures/fixtures.go +++ b/pkg/cloudprovider/providers/vsphere/vclib/fixtures/fixtures.go @@ -24,10 +24,17 @@ import ( ) var ( - CaCertPath string - ServerCertPath string - ServerKeyPath string - InvalidCaCertPath string + // CaCertPath is the filepath to a certificate that can be used as a CA + // certificate. + CaCertPath string + // ServerCertPath is the filepath to a leaf certifiacte signed by the CA at + // `CaCertPath`. + ServerCertPath string + // ServerKeyPath is the filepath to the private key for the ceritifiacte at + // `ServerCertPath`. + ServerKeyPath string + // InvalidCertPath is the filepath to an invalid certificate. + InvalidCertPath string ) func init() { @@ -54,5 +61,5 @@ func init() { CaCertPath = filepath.Join(fixturesDir, "ca.pem") ServerCertPath = filepath.Join(fixturesDir, "server.pem") ServerKeyPath = filepath.Join(fixturesDir, "server.key") - InvalidCaCertPath = filepath.Join(fixturesDir, "invalid.pem") + InvalidCertPath = filepath.Join(fixturesDir, "invalid.pem") }