Skip to content

Commit

Permalink
Add style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ismirlia committed Nov 20, 2023
1 parent 1276951 commit a35c6fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions clients/instance/ibm-pi-workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ func (f *IBMPIWorkspacesClient) Create(name, location, groupID, plan string) (*r
return nil, nil, fmt.Errorf("workspace creation error, incorrect plan value; either \"public\" or \"private\" is allowed")
}
params := resourceController.NewCreateResourceInstanceOptions(name, location, groupID, planID)
controller, response, err := resourceController.CreateResourceInstance(params)
workspace, response, err := resourceController.CreateResourceInstance(params)
if err != nil {
return nil, response, fmt.Errorf("error creating workspace: controller %v response %v err %v", controller, response, err)
return nil, response, fmt.Errorf("error creating workspace: workspace %v response %v err %v", workspace, response, err)
}
if response.StatusCode >= 400 {
return nil, response, fmt.Errorf("error creating resource instance. Status code: %d", response.StatusCode)
}
return controller, response, nil
return workspace, response, nil
}

// Delete a workspace
Expand All @@ -116,12 +116,12 @@ func (f *IBMPIWorkspacesClient) GetRC(rcWorkspaceID string) (*resourcecontroller
return nil, nil, fmt.Errorf("error creating Resource Controller client: %v", err)
}
params := resourceController.NewGetResourceInstanceOptions(rcWorkspaceID)
controller, response, err := resourceController.GetResourceInstance(params)
workspace, response, err := resourceController.GetResourceInstance(params)
if err != nil {
return nil, response, fmt.Errorf("error creating workspace: controller %v response %v err %v", controller, response, err)
return nil, response, fmt.Errorf("error creating workspace: workspace %v response %v err %v", workspace, response, err)
}
if response.StatusCode >= 400 {
return nil, response, fmt.Errorf("error getting resource instance. Status code: %d", response.StatusCode)
}
return controller, response, nil
return workspace, response, nil
}
3 changes: 1 addition & 2 deletions ibmpisession/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ func SDKFailWithAPIError(err error, origErr error) error {

// CreateResourceControllerV2 returns a resourceControllerV2
func CreateResourceControllerV2(url string, authenticator core.Authenticator) (service *rc.ResourceControllerV2, err error) {
endpoint := url
env := ""
if strings.Contains(endpoint, "test") {
if strings.Contains(url, "test") {
env = ".test"
}
rcUrl := "https://resource-controller" + env + ".cloud.ibm.com"
Expand Down

0 comments on commit a35c6fb

Please sign in to comment.