client: refactor SearchOptions to ImageSearchOptions

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
Austin Vazquez
2025-08-21 21:17:24 -05:00
parent 40025bdf43
commit 4665aa11ce
7 changed files with 14 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ func TestImageSearchAnyError(t *testing.T) {
client := &Client{
client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")),
}
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{})
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{})
assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
}
@@ -30,7 +30,7 @@ func TestImageSearchStatusUnauthorizedError(t *testing.T) {
client := &Client{
client: newMockClient(errorMock(http.StatusUnauthorized, "Unauthorized error")),
}
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{})
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{})
assert.Check(t, is.ErrorType(err, cerrdefs.IsUnauthorized))
}
@@ -41,7 +41,7 @@ func TestImageSearchWithUnauthorizedErrorAndPrivilegeFuncError(t *testing.T) {
privilegeFunc := func(_ context.Context) (string, error) {
return "", errors.New("Error requesting privilege")
}
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
PrivilegeFunc: privilegeFunc,
})
assert.Check(t, is.Error(err, "Error requesting privilege"))
@@ -54,7 +54,7 @@ func TestImageSearchWithUnauthorizedErrorAndAnotherUnauthorizedError(t *testing.
privilegeFunc := func(_ context.Context) (string, error) {
return "a-auth-header", nil
}
_, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
_, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
PrivilegeFunc: privilegeFunc,
})
assert.Check(t, is.ErrorType(err, cerrdefs.IsUnauthorized))
@@ -99,7 +99,7 @@ func TestImageSearchWithPrivilegedFuncNoError(t *testing.T) {
privilegeFunc := func(_ context.Context) (string, error) {
return "IAmValid", nil
}
results, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
results, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
RegistryAuth: "NotValid",
PrivilegeFunc: privilegeFunc,
})
@@ -139,7 +139,7 @@ func TestImageSearchWithoutErrors(t *testing.T) {
}, nil
}),
}
results, err := client.ImageSearch(context.Background(), "some-image", SearchOptions{
results, err := client.ImageSearch(context.Background(), "some-image", ImageSearchOptions{
Filters: filters.NewArgs(
filters.Arg("is-automated", "true"),
filters.Arg("stars", "3"),