a3339a30b5
Addresses PR review + acceptance findings: - Add leader-election RBAC: namespaced Role (coordination leases + events) and RoleBinding to the operator ServiceAccount, so controllers actually start under --leader-elect instead of looping on "leases forbidden". Verified in a kind cluster: lease acquired, both controllers start workers. - Align Go versions: bump Dockerfile.operator to golang:1.26-alpine and CI images to golang:1.26 to match go.mod (go 1.26.5); set GOTOOLCHAIN=local so the image build stays hermetic (no toolchain download). - PVC controller: add an annotation predicate so only PVCs carrying (or transitioning off of) backups.unkin.net/schedule enqueue, eliminating reconcile churn from unannotated PVCs while keeping the teardown path. - Cron validator: accept alphabetic month/day-of-week names (MON, JAN, MON-FRI) that k8up and CNPG's robfig/cron accept, still rejecting unknown names; add unit tests for both mapping paths. - Deploy ordering: extract the Namespace into its own manifest and add a config/kustomization.yaml so `kubectl apply -k config` creates the namespace first; document it in the README. - Note the credential-less push precedent (jellyfin-ha) in docker.yaml.
20 lines
656 B
Docker
20 lines
656 B
Docker
FROM golang:1.26-alpine AS builder
|
|
|
|
# Fail rather than download a toolchain: the base image must already satisfy the
|
|
# go directive in go.mod so the build stays hermetic (no network at build time).
|
|
ENV GOTOOLCHAIN=local
|
|
|
|
WORKDIR /build
|
|
|
|
# Dependencies are vendored, so the build needs no module network access or
|
|
# credentials (the cephrgw-operator dep lives in a private Gitea repo).
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 go build -mod=vendor -ldflags="-s -w" -o autobackup-operator ./cmd/operator
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
COPY --from=builder /build/autobackup-operator /usr/local/bin/autobackup-operator
|
|
|
|
ENTRYPOINT ["autobackup-operator"]
|