Update golang version in bpa-restapi-agent 62/4462/3
authorTodd Malsbary <todd.malsbary@intel.com>
Thu, 30 Sep 2021 20:08:22 +0000 (13:08 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Mon, 4 Oct 2021 23:51:16 +0000 (16:51 -0700)
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 <todd.malsbary@intel.com>
Change-Id: I862d54a2dba11aa15822a33f5d326d99b04a7b79

cmd/bpa-restapi-agent/api/imagehandler.go
cmd/bpa-restapi-agent/build/Dockerfile

index 2b68d6e..5fbf830 100644 (file)
@@ -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)
index 4fda26a..9be9b06 100644 (file)
@@ -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