Skip to content

Commit 8910e3e

Browse files
Bernd Warmuthwarber
authored andcommitted
fix: pass request options to automation http client
Signed-off-by: Bernd Warmuth <[email protected]>
1 parent 44110a2 commit 8910e3e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

api/clients/automation/automation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (a Client) Get(ctx context.Context, resourceType ResourceType, id string) (
102102
}
103103

104104
return a.makeRequestWithAdminAccess(resourceType, func(options rest.RequestOptions) (*http.Response, error) {
105-
return a.client.GET(ctx, path, rest.RequestOptions{})
105+
return a.client.GET(ctx, path, options)
106106
})
107107

108108
}

api/clients/automation/automation_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ func TestAutomationClient_Get(t *testing.T) {
5151
ResponseBody: payload,
5252
}
5353
},
54+
ValidateRequest: func(t *testing.T, req *http.Request) {
55+
adminAccessQP := req.URL.Query()["adminAccess"]
56+
assert.Len(t, adminAccessQP, 1)
57+
assert.Equal(t, "true", adminAccessQP[0])
58+
},
5459
},
5560
}
5661

0 commit comments

Comments
 (0)