Skip to content

Commit fe6701e

Browse files
authored
Merge pull request #1 from datum-cloud/claude-poc
feat: initial commit
2 parents 1cd507a + 1ef49f8 commit fe6701e

File tree

78 files changed

+7412
-275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+7412
-275
lines changed

.github/workflows/ci.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
env:
10+
GO_VERSION: '1.24'
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: ${{ env.GO_VERSION }}
22+
23+
- name: Run golangci-lint
24+
uses: golangci/golangci-lint-action@v7
25+
with:
26+
version: v2.1
27+
args: --timeout 5m
28+
29+
test:
30+
name: Unit Tests
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: actions/setup-go@v5
36+
with:
37+
go-version: ${{ env.GO_VERSION }}
38+
39+
- name: Run tests
40+
run: go test -v -race -coverprofile=coverage.out ./...
41+
42+
- name: Upload coverage
43+
if: always()
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: coverage
47+
path: coverage.out
48+
retention-days: 7
49+
50+
validate-kustomize:
51+
name: Validate Kustomize
52+
uses: datum-cloud/actions/.github/workflows/validate-kustomize.yaml@main
53+
54+
lint-workflows:
55+
name: Lint Workflows
56+
uses: datum-cloud/actions/.github/workflows/lint-workflows.yaml@main

.github/workflows/e2e.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: E2E Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
env:
11+
GO_VERSION: '1.24'
12+
TASK_X_REMOTE_TASKFILES: '1'
13+
14+
jobs:
15+
e2e:
16+
name: E2E Tests
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: Install Task
30+
run: |
31+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
32+
33+
- name: Install Flux CLI
34+
run: |
35+
curl -s https://fluxcd.io/install.sh | bash
36+
37+
- name: Install Chainsaw
38+
run: |
39+
go install github.com/kyverno/chainsaw@latest
40+
41+
- name: Run E2E tests
42+
run: task --yes ci:e2e
43+
44+
- name: Upload diagnostics
45+
if: failure()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: e2e-diagnostics
49+
path: e2e/e2e-diagnostics/
50+
retention-days: 7

.github/workflows/publish.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: ['published']
8+
9+
jobs:
10+
publish-docker:
11+
name: Publish Docker Image
12+
permissions:
13+
id-token: write
14+
contents: read
15+
packages: write
16+
attestations: write
17+
uses: datum-cloud/actions/.github/workflows/publish-docker.yaml@v1.9.0
18+
with:
19+
image-name: external-dns-webhook
20+
secrets: inherit
21+
22+
publish-kustomize-bundle:
23+
name: Publish Kustomize Bundle
24+
needs: publish-docker
25+
permissions:
26+
id-token: write
27+
contents: read
28+
packages: write
29+
uses: datum-cloud/actions/.github/workflows/publish-kustomize-bundle.yaml@v1.9.0
30+
with:
31+
bundle-name: ghcr.io/datum-cloud/external-dns-webhook/deploy
32+
bundle-path: config/base
33+
image-overlays: config/base
34+
image-name: ghcr.io/datum-cloud/external-dns-webhook
35+
secrets: inherit

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Binaries
2+
bin/
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
9+
# Test binaries
10+
*.test
11+
12+
# Output of the go coverage tool
13+
*.out
14+
coverage.html
15+
16+
# Dependency directories
17+
vendor/
18+
19+
# Go workspace file
20+
go.work
21+
22+
# IDE specific files
23+
.idea/
24+
.vscode/
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# OS specific
30+
.DS_Store
31+
Thumbs.db
32+
33+
# Task runner
34+
.task/
35+
36+
# E2E test artifacts
37+
.test-infra/
38+
chainsaw-report.json
39+
40+
# Ignore local claude settings
41+
.claude/settings.local.json

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM golang:1.24-alpine AS builder
2+
3+
WORKDIR /app
4+
5+
# Copy go mod files
6+
COPY go.mod go.sum ./
7+
RUN go mod download
8+
9+
# Copy source code
10+
COPY . .
11+
12+
# Build the binary
13+
RUN CGO_ENABLED=0 GOOS=linux go build -o datum-dns-webhook .
14+
15+
# Use distroless for minimal attack surface
16+
FROM gcr.io/distroless/static:nonroot
17+
18+
COPY --from=builder /app/datum-dns-webhook /
19+
20+
USER 65532:65532
21+
22+
ENTRYPOINT ["/datum-dns-webhook"]

0 commit comments

Comments
 (0)