rcm/submit: fix error handling
We were not correctly catching the case where more than one arch or more than one image type was specified. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
8e5b79df96
commit
96b4850554
1 changed files with 1 additions and 1 deletions
|
|
@ -135,7 +135,7 @@ func (api *API) submit(writer http.ResponseWriter, request *http.Request, _ http
|
|||
decoder := json.NewDecoder(request.Body)
|
||||
decoder.DisallowUnknownFields()
|
||||
err := decoder.Decode(&composeRequest)
|
||||
if err != nil || len(composeRequest.Architectures) == 0 || len(composeRequest.Repositories) == 0 || len(composeRequest.ImageTypes) == 0 {
|
||||
if err != nil || len(composeRequest.Architectures) != 1 || len(composeRequest.ImageTypes) != 1 || len(composeRequest.Repositories) == 0 {
|
||||
writer.WriteHeader(http.StatusBadRequest)
|
||||
errors := []string{}
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue