Skip to content

Commit

Permalink
Use updated version of NewFromEnv without parameters
Browse files Browse the repository at this point in the history
The method signature for NewFromEnv has changed that it takes
no arguments and has default parameters instead.
  • Loading branch information
orenbm committed Dec 30, 2019
1 parent 2e76b9b commit eda1d12
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/providers/conjur/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func ProviderFactory(options plugin_v1.ProviderOptions) (plugin_v1.Provider, err
log.Printf("Info: Conjur provider using Kubernetes authenticator-based authentication")

// Load the authenticator with the config from the environment, and log in to Conjur
if authenticator, err = loadAuthenticator(provider.AuthnURL, provider.Version, authenticatorTokenFile, provider.Config); err != nil {
if authenticator, err = loadAuthenticator(provider.AuthnURL, provider.Version, provider.Config); err != nil {
return nil, fmt.Errorf("ERROR: Conjur provider could not retrieve access token using the authenticator client: %s", err)
}
provider.Authenticator = authenticator
Expand Down Expand Up @@ -185,16 +185,13 @@ func (p *Provider) GetValue(id string) ([]byte, error) {
// Currently the deployment manifest for Secretless must also specify
// MY_POD_NAMESPACE and MY_POD_NAME from the pod metadata, but there is a GH
// issue logged in the authenticator for doing this via the Kubernetes API
func loadAuthenticator(authnURL string, version string, tokenFilePath string,
func loadAuthenticator(authnURL string, version string,
providerConfig conjurapi.Config) (*authenticator.Authenticator, error) {

var err error

// Set the client cert / token paths
clientCertPath := "/etc/conjur/ssl/client.pem"

// Check that required environment variables are set
config, err := authnConfig.NewFromEnv(&clientCertPath, &tokenFilePath)
config, err := authnConfig.NewFromEnv()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit eda1d12

Please sign in to comment.