Skip to content

Commit

Permalink
fix: ⚡ add updateold changes
Browse files Browse the repository at this point in the history
  • Loading branch information
titigmr committed Aug 14, 2024
1 parent e811472 commit f130b34
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
with:
context: .
file: ./Dockerfile
target: prod
provenance: false
platforms: ${{ inputs.PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion midaas/midaas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)...)

Expand Down

0 comments on commit f130b34

Please sign in to comment.