From: Todd Malsbary Date: Thu, 30 Sep 2021 20:08:22 +0000 (-0700) Subject: Update golang version in bpa-restapi-agent X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=de3d22a9939db1f5d9042743100b65a5f15fa671;p=icn.git Update golang version in bpa-restapi-agent This resolves the go: error loading module requirements error seen when building with golang 1.12. Note that beginning with golang 1.13, WriteAt returns an error of the file is opened with O_APPEND; this patch removes that flag. Signed-off-by: Todd Malsbary Change-Id: I862d54a2dba11aa15822a33f5d326d99b04a7b79 --- diff --git a/cmd/bpa-restapi-agent/api/imagehandler.go b/cmd/bpa-restapi-agent/api/imagehandler.go index 2b68d6e..5fbf830 100644 --- a/cmd/bpa-restapi-agent/api/imagehandler.go +++ b/cmd/bpa-restapi-agent/api/imagehandler.go @@ -255,7 +255,7 @@ func (h imageHandler) patchHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusInternalServerError) return } - f, err := os.OpenFile(fp, os.O_APPEND|os.O_WRONLY, 0644) + f, err := os.OpenFile(fp, os.O_WRONLY, 0644) if err != nil { log.Printf("unable to open file %s\n", err) w.WriteHeader(http.StatusInternalServerError) diff --git a/cmd/bpa-restapi-agent/build/Dockerfile b/cmd/bpa-restapi-agent/build/Dockerfile index 4fda26a..9be9b06 100644 --- a/cmd/bpa-restapi-agent/build/Dockerfile +++ b/cmd/bpa-restapi-agent/build/Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.12 AS builder +FROM golang:1.13 AS builder RUN mkdir /bpa-restapi-agent ADD . /bpa-restapi-agent WORKDIR /bpa-restapi-agent RUN make build -FROM golang:1.12 +FROM golang:1.13 COPY --from=builder /bpa-restapi-agent/build/_output/bin/bpa-restapi-agent /bpa-restapi-agent