Skip to content

Commit

Permalink
Merge pull request #12 from embano1/issue-10
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Gasch committed Mar 31, 2022
2 parents d7fd7f6 + 192baa0 commit 32c2095
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/vsphere.go
Expand Up @@ -43,16 +43,16 @@ type Client struct {
Events *event.Manager
}

// vSphere settings
type config struct {
// Config configures the vsphere client via environment variables
type Config struct {
Insecure bool `envconfig:"VCENTER_INSECURE" default:"false"`
Address string `envconfig:"VCENTER_URL" required:"true"`
SecretPath string `envconfig:"VCENTER_SECRET_PATH" required:"true" default:"/var/bindings/vsphere"`
}

// readKey reads the file from the secret path
func readKey(key string) (string, error) {
var env config
var env Config
if err := envconfig.Process("", &env); err != nil {
return "", err
}
Expand Down Expand Up @@ -112,7 +112,7 @@ func (c *Client) Logout() error {
//
// Use Logout() to release resources and perform a clean logout from vCenter.
func NewSOAP(ctx context.Context) (*govmomi.Client, error) {
var env config
var env Config
if err := envconfig.Process("", &env); err != nil {
return nil, err
}
Expand Down Expand Up @@ -180,7 +180,7 @@ func soapKeepAliveHandler(ctx context.Context, c *vim25.Client) func() error {
//
// Use Logout() to release resources and perform a clean logout from vCenter.
func NewREST(ctx context.Context, vc *vim25.Client) (*rest.Client, error) {
var env config
var env Config
if err := envconfig.Process("", &env); err != nil {
return nil, err
}
Expand Down

0 comments on commit 32c2095

Please sign in to comment.