- internal/kube/client.go: NewClient() with in-cluster + kubeconfig fallback - internal/kube/cronjob.go: JobSpec, ApplyCronJob, DeleteCronJob, TriggerJob, GetLockStatus, SuspendCronJob, ListCronJobs, ImportFromCronJob - Makefile/Dockerfile: add ha-sync-ctl build target - rbac.yaml: add batch/cronjobs+jobs permissions and watch verb on leases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23 lines
854 B
Docker
23 lines
854 B
Docker
FROM golang:1.22-alpine AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /out/ha-sync ./cmd/ha-sync && \
|
|
CGO_ENABLED=0 GOOS=linux go build -o /out/ha-sync-ui ./cmd/ha-sync-ui && \
|
|
CGO_ENABLED=0 GOOS=linux go build -o /out/ha-sync-ctl ./cmd/ha-sync-ctl
|
|
|
|
FROM alpine:3.20 AS ha-sync
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
COPY --from=build /out/ha-sync /usr/local/bin/ha-sync
|
|
ENTRYPOINT ["/usr/local/bin/ha-sync"]
|
|
|
|
FROM alpine:3.20 AS ha-sync-ui
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
COPY --from=build /out/ha-sync-ui /usr/local/bin/ha-sync-ui
|
|
ENTRYPOINT ["/usr/local/bin/ha-sync-ui"]
|
|
|
|
FROM alpine:3.20 AS ha-sync-ctl
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
COPY --from=build /out/ha-sync-ctl /usr/local/bin/ha-sync-ctl
|
|
ENTRYPOINT ["/usr/local/bin/ha-sync-ctl"]
|