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
2 changes: 1 addition & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion api/v2/checluster_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2019-2023 Red Hat, Inc.
// Copyright (c) 2019-2026 Red Hat, Inc.
// This program and the accompanying materials are made
// available under the terms of the Eclipse Public License 2.0
// which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -251,6 +251,10 @@ type CheClusterDevEnvironments struct {
// Typical uses cases include injecting organization tools/configs, initializing persistent home, etc.
// +optional
InitContainers []corev1.Container `json:"initContainers,omitempty"`
// Enables metrics for DevWorkspace Operator.
// +optional
// +kubebuilder:default:=true
Metrics *bool `json:"metrics,omitempty"`
}

// Che components configuration.
Expand Down
7 changes: 6 additions & 1 deletion api/v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions build/scripts/clear-defined-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ declare -A replaced_modules=(
["github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529"]="sean-/seed e2103e2c35297fb7e17febb81e49b312087a2372"
# https://github.com/decred/dcrd/commit/5444fa50b93dbcbd6a08c75da3eccc32490fb2b2
["github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d"]="decred/dcrd 5444fa50b93dbcbd6a08c75da3eccc32490fb2b2"
# https://github.com/prometheus-operator/prometheus-operator/commit/32d1b3dfa05d070762450efe9624bb2483c782be
["github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.90.1"]="github.com/prometheus-operator/prometheus-operator v0.90.1"
)

# replaces to have a correct link for clearlydefined.io api request
Expand Down Expand Up @@ -140,17 +142,15 @@ declare -A ignored_paths=(
["go.podman.io/storage"]="Harvesting is in progress"
["golang.org/x/tools/go/packages/packagestest"]="Harvesting is in progress"
["google.golang.org/genproto"]="Harvesting is in progress"
["k8s.io/api"]="Harvesting is in progress"
["k8s.io/apiextensions-apiserver"]="Harvesting is in progress"
["k8s.io/apimachinery"]="Harvesting is in progress"
["k8s.io/apiserver"]="Harvesting is in progress"
["k8s.io/client-go"]="Harvesting is in progress"
["k8s.io/code-generator"]="Harvesting is in progress"
["k8s.io/component-base"]="Harvesting is in progress"
["k8s.io/kms"]="Harvesting is in progress"
["k8s.io/kube-aggregator"]="Harvesting is in progress"
["k8s.io/utils"]="Harvesting is in progress"
["k8s.io/kube-openapi"]="Harvesting is in progress"
["sigs.k8s.io/controller-tools"]="Harvesting is in progress"
["github.com/prometheus-operator/prometheus-operator"]="Harvesting is in progress"
)

declare -A ignored_paths_licenses=(
Expand Down Expand Up @@ -190,16 +190,10 @@ declare -A ignored_paths_licenses=(
["golang.org/x/tools/go/packages/packagestest"]="BSD-3-Clause"
# https://github.com/googleapis/go-genproto?tab=Apache-2.0-1-ov-file
["google.golang.org/genproto"]="Apache-2.0"
# https://github.com/kubernetes/api?tab=Apache-2.0-1-ov-file
["k8s.io/api"]="Apache-2.0"
# https://github.com/kubernetes/apiextensions-apiserver?tab=Apache-2.0-1-ov-file
["k8s.io/apiextensions-apiserver"]="Apache-2.0"
# https://github.com/kubernetes/apimachinery?tab=Apache-2.0-1-ov-file
["k8s.io/apimachinery"]="Apache-2.0"
# https://github.com/kubernetes/apiserver?tab=Apache-2.0-1-ov-file
["k8s.io/apiserver"]="Apache-2.0"
# https://github.com/kubernetes/client-go?tab=Apache-2.0-1-ov-file
["k8s.io/client-go"]="Apache-2.0"
# https://github.com/kubernetes/code-generator?tab=Apache-2.0-1-ov-file
["k8s.io/code-generator"]="Apache-2.0"
# https://github.com/kubernetes/component-base?tab=Apache-2.0-1-ov-file
Expand All @@ -208,10 +202,12 @@ declare -A ignored_paths_licenses=(
["k8s.io/kms"]="Apache-2.0"
# https://github.com/kubernetes/kube-aggregator?tab=Apache-2.0-1-ov-file
["k8s.io/kube-aggregator"]="Apache-2.0"
# https://github.com/kubernetes/utils?tab=Apache-2.0-1-ov-file
["k8s.io/utils"]="Apache-2.0"
# https://github.com/kubernetes/kube-openapi?tab=Apache-2.0-1-ov-file
["k8s.io/kube-openapi"]="Apache-2.0"
# https://github.com/kubernetes-sigs/controller-tools?tab=Apache-2.0-1-ov-file
["sigs.k8s.io/controller-tools"]="Apache-2.0"
# https://github.com/prometheus-operator/prometheus-operator?tab=Apache-2.0-1-ov-file
["github.com/prometheus-operator/prometheus-operator"]="Apache-2.0"
)

declare -A declared_licenses=(
Expand Down
4 changes: 2 additions & 2 deletions build/scripts/docker-run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2019-2023 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -29,7 +29,7 @@ init() {
build() {
printf "%bBuilding image %b${IMAGE_NAME}${NC}..." "${BOLD}" "${BLUE}"
if docker build -t ${IMAGE_NAME} > docker-build-log 2>&1 -<<EOF
FROM docker.io/golang:1.24-bookworm
FROM docker.io/golang:1.25-bookworm
RUN apt update && apt install python3-pip skopeo jq rsync unzip -y && \
pip install --break-system-packages yq && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
Expand Down
2 changes: 1 addition & 1 deletion bundle/next/eclipse-che/bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -86,7 +86,7 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:next
createdAt: "2026-04-13T08:40:46Z"
createdAt: "2026-04-14T15:23:11Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
features.operators.openshift.io/cnf: "false"
Expand All @@ -108,7 +108,7 @@ metadata:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/os.linux: supported
name: eclipse-che.v7.117.0-972.next
name: eclipse-che.v7.117.0-973.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1144,7 +1144,7 @@ spec:
name: gateway-authorization-sidecar-k8s
- image: quay.io/che-incubator/header-rewrite-proxy:latest
name: gateway-header-sidecar
version: 7.117.0-972.next
version: 7.117.0-973.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -18710,6 +18710,10 @@ spec:
format: int64
minimum: -1
type: integer
metrics:
default: true
description: Enables metrics for DevWorkspace Operator.
type: boolean
networking:
description: Configuration settings related to the workspaces
networking.
Expand Down
2 changes: 1 addition & 1 deletion bundle/next/eclipse-che/metadata/annotations.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
2 changes: 1 addition & 1 deletion bundle/next/eclipse-che/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
11 changes: 10 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2019-2025 Red Hat, Inc.
// Copyright (c) 2019-2026 Red Hat, Inc.
// This program and the accompanying materials are made
// available under the terms of the Eclipse Public License 2.0
// which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -21,6 +21,7 @@ import (
"github.com/eclipse-che/che-operator/pkg/common/infrastructure"
oauthv1 "github.com/openshift/api/oauth/v1"
userv1 "github.com/openshift/api/user/v1"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"sigs.k8s.io/controller-runtime/pkg/webhook"

"github.com/eclipse-che/che-operator/controllers/namespacecache"
Expand Down Expand Up @@ -143,6 +144,10 @@ func init() {
utilruntime.Must(templatev1.Install(scheme))
}

if infrastructure.IsServiceMonitorEnabled() {
utilruntime.Must(monitoringv1.AddToScheme(scheme))
}

// User and OAuthClient API are disabled in case of external IDP
// Check API before adding to the scheme
if infrastructure.IsOpenShiftOAuthEnabled() {
Expand Down Expand Up @@ -391,6 +396,10 @@ func getCacheFunc() (cache.NewCacheFunc, error) {
selectors[&templatev1.Template{}] = cache.ByObject{Label: partOfCheObjectSelector}
}

if infrastructure.IsServiceMonitorEnabled() {
selectors[&monitoringv1.ServiceMonitor{}] = cache.ByObject{Label: partOfCheObjectSelector}
}

if infrastructure.IsOpenShiftOAuthEnabled() {
selectors[&oauthv1.OAuthClient{}] = cache.ByObject{Label: partOfCheObjectSelector}
}
Expand Down
6 changes: 5 additions & 1 deletion config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -18626,6 +18626,10 @@ spec:
format: int64
minimum: -1
type: integer
metrics:
default: true
description: Enables metrics for DevWorkspace Operator.
type: boolean
networking:
description: Configuration settings related to the workspaces
networking.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
12 changes: 11 additions & 1 deletion controllers/che/checluster_controller.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2019-2025 Red Hat, Inc.
// Copyright (c) 2019-2026 Red Hat, Inc.
// This program and the accompanying materials are made
// available under the terms of the Eclipse Public License 2.0
// which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -19,6 +19,8 @@ import (
"github.com/eclipse-che/che-operator/pkg/common/constants"
k8sclient "github.com/eclipse-che/che-operator/pkg/common/k8s-client"
"github.com/eclipse-che/che-operator/pkg/common/reconciler"
"github.com/eclipse-che/che-operator/pkg/deploy/metrics"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/controller"

Expand Down Expand Up @@ -127,6 +129,10 @@ func NewReconciler(
reconcilerManager.AddReconciler(consolelink.NewConsoleLinkReconciler())
}

if infrastructure.IsServiceMonitorEnabled() {
reconcilerManager.AddReconciler(metrics.NewMetricsReconciler())
}

return &CheClusterReconciler{
Scheme: scheme,
Log: ctrl.Log.WithName("controllers").WithName("CheCluster"),
Expand Down Expand Up @@ -182,6 +188,10 @@ func (r *CheClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
bld.Owns(&networking.Ingress{})
}

if infrastructure.IsServiceMonitorEnabled() {
bld.Owns(&monitoringv1.ServiceMonitor{})
}

if r.namespace != "" {
bld = bld.WithEventFilter(utils.InNamespaceEventFilter(r.namespace))
}
Expand Down
6 changes: 5 additions & 1 deletion deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down Expand Up @@ -18647,6 +18647,10 @@ spec:
format: int64
minimum: -1
type: integer
metrics:
default: true
description: Enables metrics for DevWorkspace Operator.
type: boolean
networking:
description: Configuration settings related to the workspaces
networking.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2024 Red Hat, Inc.
# Copyright (c) 2019-2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand Down
Loading
Loading