Skip to content

Commit

Permalink
config.go bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AdminTurnedDevOps committed Sep 16, 2020
1 parent a6fe73d commit bbdcdd3
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions octopusdeploy/config.go
Expand Up @@ -19,23 +19,12 @@ func (c *Config) Client() (*client.Client, error) {
apiClient, err := client.NewClient(&(http.Client{}), c.Address, c.APIKey, c.Space)

if c.Space == "" {
if err != nil {
log.Println(err)
}

log.Printf("[INFO] Octopus Deploy Client configured against default space")

return apiClient, nil
}

log.Printf("[INFO] Octopus Deploy Client will be scoped to %s space", c.Space)

space, err := apiClient.Spaces.GetByName(c.Space)

if err != nil {
return nil, err
}

scopedClient, err := client.ForSpace(&(http.Client{}), c.Address, c.APIKey, space)

log.Printf("[INFO] Octopus Deploy Client configured against %s space", c.Space)

return scopedClient, nil
return apiClient, err
}

0 comments on commit bbdcdd3

Please sign in to comment.