Skip to content

Commit 80147f1

Browse files
sradcoAI Assistant
andcommitted
management: add CRD support and create alert rule API
Add AlertingRule, AlertRelabelConfig, and RelabeledRules CRD interfaces with the management client, router, server wiring, and POST /api/v1/alerting/rules endpoint. Signed-off-by: Shirly Radco <sradco@redhat.com> Signed-off-by: João Vilaça <jvilaca@redhat.com> Signed-off-by: Aviv Litman <alitman@redhat.com> Co-authored-by: AI Assistant <noreply@cursor.com>
1 parent 74a097e commit 80147f1

35 files changed

Lines changed: 3066 additions & 101 deletions

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RUN make install-backend
2525

2626
COPY cmd/ cmd/
2727
COPY pkg/ pkg/
28+
COPY internal/ internal/
2829

2930
ENV GOEXPERIMENT=strictfipsruntime
3031
ENV CGO_ENABLED=1

Dockerfile.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN go mod download
2828

2929
COPY cmd/ cmd/
3030
COPY pkg/ pkg/
31+
COPY internal/ internal/
3132

3233
RUN go build -mod=mod -o plugin-backend cmd/plugin-backend.go
3334

Dockerfile.dev-mcp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RUN go mod download
3131

3232
COPY cmd/ cmd/
3333
COPY pkg/ pkg/
34+
COPY internal/ internal/
3435

3536
RUN go build -mod=mod -o plugin-backend cmd/plugin-backend.go
3637

Dockerfile.devspace

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN make install-backend
2020
COPY config/ config/
2121
COPY cmd/ cmd/
2222
COPY pkg/ pkg/
23+
COPY internal/ internal/
2324

2425
RUN make build-backend
2526

Dockerfile.konflux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN make install-backend
2828

2929
COPY cmd/ cmd/
3030
COPY pkg/ pkg/
31+
COPY internal/ internal/
3132

3233
ENV GOEXPERIMENT=strictfipsruntime
3334
ENV CGO_ENABLED=1

Dockerfile.mcp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN make install-backend
2828

2929
COPY cmd/ cmd/
3030
COPY pkg/ pkg/
31+
COPY internal/ internal/
3132

3233
ENV GOOS=${TARGETOS:-linux}
3334
ENV GOARCH=${TARGETARCH}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ start-backend:
5656

5757
.PHONY: test-backend
5858
test-backend:
59-
go test ./pkg/... -v
59+
go test ./pkg/... ./internal/... -v
60+
61+
.PHONY: test-e2e
62+
test-e2e:
63+
PLUGIN_URL=http://localhost:9001 go test -v -timeout=150m -count=1 ./test/e2e
6064

6165
.PHONY: test-frontend
6266
test-frontend:

go.mod

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,79 @@
11
module github.com/openshift/monitoring-plugin
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/evanphx/json-patch v4.12.0+incompatible
77
github.com/gorilla/handlers v1.5.2
88
github.com/gorilla/mux v1.8.1
9+
github.com/onsi/ginkgo/v2 v2.27.2
10+
github.com/onsi/gomega v1.38.2
11+
github.com/openshift/api v0.0.0-20251122153900-88cca31a44c9
912
github.com/openshift/client-go v0.0.0-20251123231646-4685125c2287
1013
github.com/openshift/library-go v0.0.0-20240905123346-5bdbfe35a6f5
1114
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.0
1215
github.com/prometheus-operator/prometheus-operator/pkg/client v0.87.0
13-
github.com/sirupsen/logrus v1.9.3
16+
github.com/prometheus/common v0.67.5
17+
github.com/prometheus/prometheus v0.310.0
18+
github.com/sirupsen/logrus v1.9.4
1419
github.com/stretchr/testify v1.11.1
1520
gopkg.in/yaml.v2 v2.4.0
16-
k8s.io/api v0.34.2
17-
k8s.io/apimachinery v0.34.2
21+
k8s.io/api v0.35.0
22+
k8s.io/apimachinery v0.35.0
1823
k8s.io/apiserver v0.34.2
19-
k8s.io/client-go v0.34.2
24+
k8s.io/client-go v0.35.0
2025
)
2126

2227
require (
28+
github.com/Masterminds/semver/v3 v3.4.0 // indirect
29+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2330
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2431
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
2532
github.com/felixge/httpsnoop v1.0.4 // indirect
2633
github.com/fsnotify/fsnotify v1.9.0 // indirect
2734
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
2835
github.com/go-logr/logr v1.4.3 // indirect
29-
github.com/go-openapi/jsonpointer v0.22.1 // indirect
30-
github.com/go-openapi/jsonreference v0.21.2 // indirect
31-
github.com/go-openapi/swag v0.25.1 // indirect
32-
github.com/go-openapi/swag/cmdutils v0.25.1 // indirect
33-
github.com/go-openapi/swag/conv v0.25.1 // indirect
34-
github.com/go-openapi/swag/fileutils v0.25.1 // indirect
35-
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
36-
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
37-
github.com/go-openapi/swag/loading v0.25.1 // indirect
38-
github.com/go-openapi/swag/mangling v0.25.1 // indirect
39-
github.com/go-openapi/swag/netutils v0.25.1 // indirect
40-
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
41-
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
42-
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
36+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
37+
github.com/go-openapi/jsonreference v0.21.4 // indirect
38+
github.com/go-openapi/swag v0.25.4 // indirect
39+
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
40+
github.com/go-openapi/swag/conv v0.25.4 // indirect
41+
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
42+
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
43+
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
44+
github.com/go-openapi/swag/loading v0.25.4 // indirect
45+
github.com/go-openapi/swag/mangling v0.25.4 // indirect
46+
github.com/go-openapi/swag/netutils v0.25.4 // indirect
47+
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
48+
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
49+
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
50+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
4351
github.com/gogo/protobuf v1.3.2 // indirect
4452
github.com/google/gnostic-models v0.7.0 // indirect
4553
github.com/google/go-cmp v0.7.0 // indirect
46-
github.com/google/pprof v0.0.0-20250923004556-9e5a51aed1e8 // indirect
54+
github.com/google/pprof v0.0.0-20260202012954-cb029daf43ef // indirect
4755
github.com/google/uuid v1.6.0 // indirect
56+
github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 // indirect
4857
github.com/json-iterator/go v1.1.12 // indirect
4958
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5059
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
5160
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
52-
github.com/openshift/api v0.0.0-20251122153900-88cca31a44c9 // indirect
5361
github.com/pkg/errors v0.9.1 // indirect
5462
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
63+
github.com/prometheus/client_model v0.6.2 // indirect
5564
github.com/x448/float16 v0.8.4 // indirect
5665
go.yaml.in/yaml/v2 v2.4.3 // indirect
5766
go.yaml.in/yaml/v3 v3.0.4 // indirect
58-
golang.org/x/net v0.46.0 // indirect
59-
golang.org/x/oauth2 v0.32.0 // indirect
60-
golang.org/x/sys v0.37.0 // indirect
61-
golang.org/x/term v0.36.0 // indirect
62-
golang.org/x/text v0.30.0 // indirect
63-
golang.org/x/time v0.13.0 // indirect
64-
google.golang.org/protobuf v1.36.10 // indirect
67+
golang.org/x/mod v0.32.0 // indirect
68+
golang.org/x/net v0.49.0 // indirect
69+
golang.org/x/oauth2 v0.34.0 // indirect
70+
golang.org/x/sync v0.19.0 // indirect
71+
golang.org/x/sys v0.40.0 // indirect
72+
golang.org/x/term v0.39.0 // indirect
73+
golang.org/x/text v0.33.0 // indirect
74+
golang.org/x/time v0.14.0 // indirect
75+
golang.org/x/tools v0.41.0 // indirect
76+
google.golang.org/protobuf v1.36.11 // indirect
6577
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
6678
gopkg.in/inf.v0 v0.9.1 // indirect
6779
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)