diff --git a/Dockerfile b/Dockerfile index 687ee64..a178e9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN go mod download COPY configs ./configs -RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc -o mc +RUN curl https://dl.min.io/client/mc/release/linux-arm64/mc -o mc RUN chmod +x ./mc diff --git a/main.go b/main.go index b6400d6..855dea5 100644 --- a/main.go +++ b/main.go @@ -483,16 +483,20 @@ func main() { reader := bytes.NewReader(buf.Bytes()) - result, err := minio.uploadFile(reader, mapTags, float64(fileSize), fileName, contentType, boolTemporary) + results, err := minio.uploadFile(reader, mapTags, float64(fileSize), fileName, contentType, boolTemporary) if err != nil { c.JSON(500, gin.H{ "message": "Something happened when trying to upload the file!", }) } else { - c.JSON(201, gin.H{ - "message": result, - }) + if len(results) == 0 { + c.JSON(404, gin.H{ + "message": "Could not upload the file in any of the instances!", + }) + } else { + c.JSON(201, results) + } } } }