Skip to content

Commit 325f456

Browse files
Merge pull request #2490 from machine424/stop-invalid-config
MON-4046: add early validation for Platform and UWM monitoring configmaps
2 parents f1ede96 + f0e97c2 commit 325f456

File tree

103 files changed

+5138
-443
lines changed

Some content is hidden

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

103 files changed

+5138
-443
lines changed

Documentation/resources.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,5 @@ This also exposes the gRPC endpoints on port 10901. This port is for internal us
182182

183183
=== openshift-monitoring/cluster-monitoring-operator
184184

185-
Expose the `/metrics` endpoint on port 8443. This port is for internal use, and no other usage is guaranteed.
185+
Expose the `/metrics` and `/validate-webhook` endpoints on port 8443. This port is for internal use, and no other usage is guaranteed.
186186

Documentation/resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,5 @@ This also exposes the gRPC endpoints on port 10901. This port is for internal us
163163

164164
### openshift-monitoring/cluster-monitoring-operator
165165

166-
Expose the `/metrics` endpoint on port 8443. This port is for internal use, and no other usage is guaranteed.
166+
Expose the `/metrics` and `/validate-webhook` endpoints on port 8443. This port is for internal use, and no other usage is guaranteed.
167167

cmd/operator/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ import (
2929
"k8s.io/apimachinery/pkg/util/yaml"
3030
"k8s.io/client-go/tools/clientcmd"
3131
"k8s.io/klog/v2"
32+
runtimelog "sigs.k8s.io/controller-runtime/pkg/log"
3233

3334
"github.com/openshift/cluster-monitoring-operator/pkg/manifests"
34-
"github.com/openshift/cluster-monitoring-operator/pkg/metrics"
3535
cmo "github.com/openshift/cluster-monitoring-operator/pkg/operator"
36+
"github.com/openshift/cluster-monitoring-operator/pkg/server"
3637
)
3738

3839
type images map[string]string
@@ -85,6 +86,7 @@ type telemetryConfig struct {
8586
func Main() int {
8687
flagset := flag.CommandLine
8788
klog.InitFlags(flagset)
89+
runtimelog.SetLogger(klog.Background())
8890
namespace := flagset.String("namespace", "openshift-monitoring", "Namespace to deploy and manage cluster monitoring stack in.")
8991
namespaceUserWorkload := flagset.String("namespace-user-workload", "openshift-user-workload-monitoring", "Namespace to deploy and manage user workload monitoring stack in.")
9092
configMapName := flagset.String("configmap", "cluster-monitoring-config", "ConfigMap name to configure the cluster monitoring stack.")
@@ -201,12 +203,12 @@ func Main() int {
201203

202204
wg.Go(func() error { return o.Run(ctx) })
203205

204-
srv, err := metrics.NewServer("cluster-monitoring-operator", config, *kubeconfigPath, *certFile, *keyFile)
206+
srv, err := server.NewServer("cluster-monitoring-operator", config, *kubeconfigPath, *certFile, *keyFile)
205207
if err != nil {
206208
fmt.Fprint(os.Stderr, err)
207209
return 1
208210
}
209-
wg.Go(func() error { return srv.Run(ctx) })
211+
wg.Go(func() error { return srv.Run(ctx, o.CollectionProfilesEnabled) })
210212

211213
term := make(chan os.Signal, 1)
212214
signal.Notify(term, os.Interrupt, syscall.SIGTERM)

go.mod

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ require (
2121
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.76.0
2222
github.com/prometheus-operator/prometheus-operator/pkg/client v0.76.0
2323
github.com/prometheus/alertmanager v0.27.0
24-
github.com/prometheus/client_golang v1.20.0
25-
github.com/prometheus/common v0.59.1
24+
github.com/prometheus/client_golang v1.20.4
25+
github.com/prometheus/common v0.60.0
2626
github.com/prometheus/prometheus v0.54.1
2727
github.com/stretchr/testify v1.9.0
2828
golang.org/x/sync v0.8.0
29-
golang.org/x/text v0.18.0
29+
golang.org/x/text v0.19.0
3030
gopkg.in/yaml.v2 v2.4.0
3131
gopkg.in/yaml.v3 v3.0.1
3232
k8s.io/api v0.31.1
@@ -40,6 +40,7 @@ require (
4040
k8s.io/kube-aggregator v0.31.1
4141
k8s.io/metrics v0.31.1
4242
k8s.io/utils v0.0.0-20240921022957-49e7df575cb6
43+
sigs.k8s.io/controller-runtime v0.19.0
4344
sigs.k8s.io/yaml v1.4.0
4445
)
4546

@@ -91,7 +92,7 @@ require (
9192
github.com/josharian/intern v1.0.0 // indirect
9293
github.com/jpillora/backoff v1.0.0 // indirect
9394
github.com/json-iterator/go v1.1.12 // indirect
94-
github.com/klauspost/compress v1.17.9 // indirect
95+
github.com/klauspost/compress v1.17.10 // indirect
9596
github.com/kylelemons/godebug v1.1.0 // indirect
9697
github.com/mailru/easyjson v0.7.7 // indirect
9798
github.com/mitchellh/mapstructure v1.5.0 // indirect
@@ -127,13 +128,14 @@ require (
127128
go.uber.org/atomic v1.11.0 // indirect
128129
go.uber.org/multierr v1.11.0 // indirect
129130
go.uber.org/zap v1.26.0 // indirect
130-
golang.org/x/crypto v0.27.0 // indirect
131-
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
132-
golang.org/x/net v0.29.0 // indirect
133-
golang.org/x/oauth2 v0.22.0 // indirect
134-
golang.org/x/sys v0.25.0 // indirect
135-
golang.org/x/term v0.24.0 // indirect
136-
golang.org/x/time v0.6.0 // indirect
131+
golang.org/x/crypto v0.28.0 // indirect
132+
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 // indirect
133+
golang.org/x/net v0.30.0 // indirect
134+
golang.org/x/oauth2 v0.23.0 // indirect
135+
golang.org/x/sys v0.26.0 // indirect
136+
golang.org/x/term v0.25.0 // indirect
137+
golang.org/x/time v0.7.0 // indirect
138+
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
137139
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
138140
google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d // indirect
139141
google.golang.org/genproto/googleapis/rpc v0.0.0-20240708141625-4ad9e859172b // indirect
@@ -143,9 +145,8 @@ require (
143145
gopkg.in/inf.v0 v0.9.1 // indirect
144146
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
145147
k8s.io/kms v0.31.1 // indirect
146-
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect
148+
k8s.io/kube-openapi v0.0.0-20240903163716-9e1beecbcb38 // indirect
147149
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
148-
sigs.k8s.io/controller-runtime v0.18.5 // indirect
149150
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
150151
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
151152
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

0 commit comments

Comments
 (0)