Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container registry data fixes #284

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type ContainerRegistryService interface {
UpdateRepository(ctx context.Context, vcrID, imageName string, updateReq *ContainerRegistryRepoUpdateReq) (*ContainerRegistryRepo, *http.Response, error) //nolint:lll
DeleteRepository(ctx context.Context, vcrID, imageName string) error
CreateDockerCredentials(ctx context.Context, vcrID string, createOptions *DockerCredentialsOpt) (*ContainerRegistryDockerCredentials, *http.Response, error) //nolint:lll
ListRegions(ctx context.Context, options *ListOptions) ([]ContainerRegistryRegion, *Meta, *http.Response, error)
ListRegions(ctx context.Context) ([]ContainerRegistryRegion, *Meta, *http.Response, error)
ListPlans(ctx context.Context) (*ContainerRegistryPlans, *http.Response, error)
}

Expand Down Expand Up @@ -106,8 +106,8 @@ type ContainerRegistryReq struct {

// ContainerRegistryUpdateReq represents the data used to update a registry
type ContainerRegistryUpdateReq struct {
Public *bool `json:"public"`
Plan *string `json:"plan"`
Public *bool `json:"public,omitempty"`
Plan *string `json:"plan,omitempty"`
}

// ContainerRegistryRepo represents the data of a registry repository
Expand Down Expand Up @@ -392,7 +392,7 @@ func (h *ContainerRegistryServiceHandler) CreateDockerCredentials(ctx context.Co

// ListRegions will return a list of regions relevant to the container registry
// API operations
func (h *ContainerRegistryServiceHandler) ListRegions(ctx context.Context, options *ListOptions) ([]ContainerRegistryRegion, *Meta, *http.Response, error) { //nolint:lll
func (h *ContainerRegistryServiceHandler) ListRegions(ctx context.Context) ([]ContainerRegistryRegion, *Meta, *http.Response, error) {
req, errReq := h.client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("%s/region/list", vcrPath), nil)
if errReq != nil {
return nil, nil, nil, errReq
Expand Down
4 changes: 2 additions & 2 deletions container_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ func TestVCRServiceHandler_ListRegions(t *testing.T) {
fmt.Fprint(writer, response)
})

vcrRegions, meta, _, err := client.ContainerRegistry.ListRegions(ctx, nil)
vcrRegions, meta, _, err := client.ContainerRegistry.ListRegions(ctx)
if err != nil {
t.Errorf("ContainerRegistry.ListRegions returned %v", err)
}
Expand Down Expand Up @@ -1014,7 +1014,7 @@ func TestVCRServiceHandler_ListRegions(t *testing.T) {

c, can := context.WithTimeout(ctx, 1*time.Microsecond)
defer can()
_, _, _, err = client.ContainerRegistry.ListRegions(c, nil)
_, _, _, err = client.ContainerRegistry.ListRegions(c)
if err == nil {
t.Error("ContainerRegistry.ListRegions returned nil")
}
Expand Down