Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/release-pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,29 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Checkout code
uses: actions/checkout@v4

- name: Echo Build Version
run: echo "BUILD_VERSION=${{ github.sha }}"

- name: Build and NOT push
id: build
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.platform }}
push: false
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_VERSION=${{ github.sha }}

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
go-version: '1.25.3' # same as go.mod
- name: Gather dependencies
run: go mod download
- name: Run coverage
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Echo Build Version
run: echo "BUILD_VERSION=${{ github.sha }}"

- name: Prepare
run: |
platform=${{ matrix.platform }}
Expand Down Expand Up @@ -56,6 +62,8 @@ jobs:
push: true
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
build-args: |
BUILD_VERSION=${{ github.sha }}

- name: Export digest
run: |
Expand Down Expand Up @@ -124,7 +132,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
go-version: '1.25.3' # same as go.mod
- name: Gather dependencies
run: go mod download
- name: Run coverage
Expand Down
3 changes: 2 additions & 1 deletion .ko.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
builds:
- id: rest-dynamic-controller
#main: main.go
dir: .
dir: .
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -extldflags "-static"
- -X main.Build={{.Git.Commit}}
defaultPlatforms:
- linux/arm64
#- linux/amd64
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ COPY internal/ internal/
COPY main.go main.go

# Build
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o /bin/controller ./main.go && \
ARG BUILD_VERSION
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -ldflags="-X 'main.Build=${BUILD_VERSION}'" -o /bin/controller ./main.go && \
strip /bin/controller

# Deployment environment
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ The following environment variables can be configured in the rest-dynamic-contro
| Name | Description | Default Value |
|------|--------------|---------------|
| REST_CONTROLLER_DEBUG | Enable verbose output | `false` |
| REST_CONTROLLER_PRETTY_JSON_DEBUG | Enable pretty-print JSON formatting in HTTP debug output (response bodies) | `false` |
| REST_CONTROLLER_WORKERS | Number of worker threads | `1` |
| REST_CONTROLLER_RESYNC_INTERVAL | Interval between resyncs | `1m` |
| REST_CONTROLLER_GROUP | Resource API group | - |
Expand Down
50 changes: 20 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
module github.com/krateoplatformops/rest-dynamic-controller

go 1.25.0
go 1.25.3

require (
github.com/go-andiamo/splitter v1.2.5
github.com/go-logr/logr v1.4.2
github.com/go-logr/logr v1.4.3
github.com/gobuffalo/flect v1.0.3
github.com/google/go-cmp v0.7.0
github.com/krateoplatformops/plumbing v0.6.1
github.com/krateoplatformops/snowplow v0.0.0-20250311104630-6e215130151f
github.com/krateoplatformops/unstructured-runtime v0.3.0
github.com/krateoplatformops/plumbing v0.9.4
github.com/krateoplatformops/unstructured-runtime v0.3.1
github.com/pb33f/libopenapi v0.28.0
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.33.2
k8s.io/apimachinery v0.33.2
k8s.io/client-go v0.33.2
k8s.io/api v0.34.2
k8s.io/apimachinery v0.34.2
k8s.io/client-go v0.34.2
sigs.k8s.io/controller-runtime v0.20.0
sigs.k8s.io/e2e-framework v0.6.0
)
Expand All @@ -27,31 +26,27 @@ require (
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/itchyny/gojq v0.12.17 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/moby/spdystream v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -62,7 +57,7 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/speakeasy-api/jsonpath v0.6.2 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/twmb/murmur3 v1.1.8 // indirect
github.com/vladimirvivien/gexe v0.4.1 // indirect
Expand All @@ -72,30 +67,25 @@ require (
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/mod v0.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/oauth2 v0.29.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.32.0 // indirect
k8s.io/component-base v0.32.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/controller-tools v0.16.5 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

replace github.com/pb33f/libopenapi => github.com/krateoplatformops/libopenapi v0.21.8
Loading