diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da1e143..4e3116f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -152,6 +152,7 @@ jobs: with: context: . file: ./Dockerfile + target: prod provenance: false platforms: ${{ inputs.PLATFORMS }} tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 7ecfb8a..d33f4ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +# Dev stage +FROM --platform=${BUILDPLATFORM:-linux/amd64} docker.io/golang:1.22.4 AS dev +RUN go install github.com/air-verse/air@latest +WORKDIR /go/src/app +COPY go.mod go.mod +COPY go.sum go.sum +RUN go mod tidy +ENTRYPOINT ["air"] + # Build stage FROM --platform=${BUILDPLATFORM:-linux/amd64} docker.io/golang:1.22.4 AS build diff --git a/midaas/midaas.go b/midaas/midaas.go index ee0120e..fd571f0 100644 --- a/midaas/midaas.go +++ b/midaas/midaas.go @@ -145,9 +145,10 @@ func (p *midaasProvider) ApplyRecord(action string, recordInfo *ZoneRecord) erro } func (p *midaasProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error { - combinedChanges := make([]*ChangeRecord, 0, len(changes.Create)+len(changes.UpdateNew)+len(changes.Delete)) + combinedChanges := make([]*ChangeRecord, 0, len(changes.Create)+len(changes.UpdateNew)+len(changes.Delete)+len(changes.UpdateOld)) combinedChanges = append(combinedChanges, p.newChanges(dnsCreate, changes.Create)...) + combinedChanges = append(combinedChanges, p.newChanges(dnsDelete, changes.UpdateOld)...) combinedChanges = append(combinedChanges, p.newChanges(dnsUpdate, changes.UpdateNew)...) combinedChanges = append(combinedChanges, p.newChanges(dnsDelete, changes.Delete)...)