Skip to content

Commit

Permalink
fix: pass request options to automation http client
Browse files Browse the repository at this point in the history
Signed-off-by: Bernd Warmuth <[email protected]>
  • Loading branch information
warber committed Oct 4, 2024
1 parent 44110a2 commit 8910e3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/clients/automation/automation.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (a Client) Get(ctx context.Context, resourceType ResourceType, id string) (
}

return a.makeRequestWithAdminAccess(resourceType, func(options rest.RequestOptions) (*http.Response, error) {
return a.client.GET(ctx, path, rest.RequestOptions{})
return a.client.GET(ctx, path, options)
})

}
Expand Down
5 changes: 5 additions & 0 deletions api/clients/automation/automation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func TestAutomationClient_Get(t *testing.T) {
ResponseBody: payload,
}
},
ValidateRequest: func(t *testing.T, req *http.Request) {
adminAccessQP := req.URL.Query()["adminAccess"]
assert.Len(t, adminAccessQP, 1)
assert.Equal(t, "true", adminAccessQP[0])
},
},
}

Expand Down

0 comments on commit 8910e3e

Please sign in to comment.