images: Support updating distribution and description. (#413)
This commit is contained in:
parent
f70bf7fdf2
commit
45fcf9e782
|
@ -52,7 +52,9 @@ type Image struct {
|
|||
|
||||
// ImageUpdateRequest represents a request to update an image.
|
||||
type ImageUpdateRequest struct {
|
||||
Name string `json:"name"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Distribution string `json:"distribution,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// CustomImageCreateRequest represents a request to create a custom image.
|
||||
|
|
|
@ -353,12 +353,16 @@ func TestImages_Update(t *testing.T) {
|
|||
defer teardown()
|
||||
|
||||
updateRequest := &ImageUpdateRequest{
|
||||
Name: "name",
|
||||
Name: "name",
|
||||
Distribution: "Fedora",
|
||||
Description: "Just testing...",
|
||||
}
|
||||
|
||||
mux.HandleFunc("/v2/images/12345", func(w http.ResponseWriter, r *http.Request) {
|
||||
expected := map[string]interface{}{
|
||||
"name": "name",
|
||||
"name": "name",
|
||||
"distribution": "Fedora",
|
||||
"description": "Just testing...",
|
||||
}
|
||||
|
||||
var v map[string]interface{}
|
||||
|
|
Loading…
Reference in New Issue