mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-06 03:57:52 +09:00
Upstream COSI v0.2.2's BucketAccess reconciler does a Get->mutate->Update
on the parent Bucket and surfaces "Operation cannot be fulfilled ... the
object has been modified" as a FailedGrantAccess event when it races
against the Bucket reconciler in the same controller process. Wrap the
mutation in retry.RetryOnConflict so the reconcile loop refreshes and
retries instead of leaking the conflict to users.
Carried as 91-bucketaccess-conflict-retry.diff until upstreamed
(cf. 89-reconciliation.diff and 90-bucket-name.diff, both dropped
in c29d501b once merged upstream).
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
35 lines
997 B
Docker
35 lines
997 B
Docker
# syntax=docker/dockerfile:1.2
|
|
|
|
FROM alpine AS source
|
|
ARG COMMIT_REF=v0.2.2
|
|
RUN apk add --no-cache curl tar git
|
|
WORKDIR /src
|
|
|
|
RUN curl -sSL https://github.com/kubernetes-sigs/container-object-storage-interface/archive/${COMMIT_REF}.tar.gz \
|
|
| tar -xz --strip-components=1
|
|
|
|
COPY patches /patches
|
|
RUN git apply /patches/*.diff
|
|
|
|
FROM --platform=$BUILDPLATFORM docker.io/golang:1.24 AS builder
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
|
|
WORKDIR /go/src/cosi
|
|
|
|
COPY --from=source /src/go.mod /src/go.sum /src ./
|
|
RUN go mod download
|
|
|
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /build/controller ./controller/cmd \
|
|
&& CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /build/sidecar ./sidecar/cmd
|
|
|
|
FROM gcr.io/distroless/static:nonroot AS controller
|
|
COPY --from=builder /build/controller /controller
|
|
USER 65532:65532
|
|
ENTRYPOINT ["/controller"]
|
|
|
|
FROM gcr.io/distroless/static:nonroot AS sidecar
|
|
COPY --from=builder /build/sidecar /sidecar
|
|
USER 65532:65532
|
|
ENTRYPOINT ["/sidecar"]
|