← Back to Pull requests

ACM-37236: feat: onboard Thanos Operator into COO #1151

Open
coleenquadros opened this pull request with 37280 lines diff across 46 files
View on GitHub
coleenquadros coleenquadros commented on Jul 09, 2026 10:54 UTC
Author

Summary

ACM-37236

Onboard the Thanos Operator into COO following the same pattern as the Perses operator onboarding.

  • Add deploy/thanos/ directory with 5 CRDs (monitoring.thanos.io/v1alpha1), operator deployment, RBAC, and user-facing editor/viewer roles

  • Wire into OLM bundle via deploy/olm/kustomization.yaml

  • Register Thanos CRDs as owned in the CSV

  • Add Go dependency on github.com/thanos-community/thanos-operator and register types in scheme

  • Add generate-thanos-op-crds Makefile target

  • Add default thanos-operator image in cmd/operator/main.go
  • CRDs added

    | Kind | API Group | Scope |
    |---|---|---|
    | ThanosQuery | monitoring.thanos.io | Namespaced |
    | ThanosReceive | monitoring.thanos.io | Namespaced |
    | ThanosCompact | monitoring.thanos.io | Namespaced |
    | ThanosStore | monitoring.thanos.io | Namespaced |
    | ThanosRuler | monitoring.thanos.io | Namespaced |

    API support level: TechPreviewNoUpgrade

    Pattern followed

    Same as Perses operator onboarding (commit 5ba0330):

  • Local CRD files with kustomize annotations

  • Dedicated deployment, service account, cluster role

  • User-facing editor/viewer ClusterRoles per CRD

  • Types registered in pkg/operator/scheme.go under OpenShift feature gate
  • Jira: ACM-37236

    Test plan

  • go build ./... passes

  • kustomize build deploy/olm/ renders all Thanos resources correctly

  • go test ./... unit tests pass (e2e skipped — requires live cluster)

  • Deploy to test cluster and verify CRDs are created
  • 🤖 Generated with Claude Code

    Diff: 37280 lines (+37279 / -1) across 46 files Reviewer: danielmellado Review duration: 166533m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.79) × (1 − Review Confidence (0.75)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.79 · 37280 lines diff across 46 files
    0.79
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.55 · 5 substantive comment(s)
    0.55
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    75%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    26 items
    coderabbitai[bot] coderabbitai[bot] commented on Jul 09, 2026 10:55 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    ![Review Change Stack](https://app.coderabbit.ai/change-stack/rhobs/observability-operator/pull/1151?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

    <!-- review_stack_entry_end -->
    <!-- This is an auto-generated comment: review paused by coderabbit.ai -->

    [!NOTE]

    ## Reviews paused

    > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

    > - Last reviewed commit: none yet

    - Latest commit, not reviewed: 976f0ef8dbcb69f0fc6b8b3774deb44e403d66d7

    > Use the following commands to manage reviews:

    - @coderabbitai resume to resume automatic reviews.

    - @coderabbitai review to trigger a single review.

    > Use the checkboxes below for quick actions:

    - [ ] <!-- {"checkboxId": "7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews

    - [ ] <!-- {"checkboxId": "e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review

    <!-- end of auto-generated comment: review paused by coderabbit.ai -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>📝 Walkthrough</strong></summary>
    <dl>
    <dd>

    Adds Thanos operator support through dependency and scheme registration, CRD generation, Kubernetes deployment and RBAC manifests, image configuration, and OLM packaging. The change adds five Thanos resource types, editor and viewer roles, manager permissions, leader-election permissions, and bundle metadata.

    Estimated code review effort: 4 (Complex) | ~45 minutes

    Suggested reviewers: simonpasquier, jgbernalp

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>🚥 Pre-merge checks | ✅ 4 | ❌ 1</strong></summary>
    <dl>
    <dd>

    ❌ Failed checks (1 warning)

    | Check name | Status | Explanation | Resolution |
    | :---------------- | :--------- | :----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
    | Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |

    <details>
    <summary><strong>✅ Passed checks (4 passed)</strong></summary>
    <dl>
    <dd>

    | Check name | Status | Explanation |
    | :------------------------ | :------- | :------------------------------------------------------------------------------------------------------------------ |
    | Description check | ✅ Passed | The description clearly explains the Thanos Operator onboarding changes, validation, and remaining deployment work. |
    | Title check | ✅ Passed | The title clearly identifies the Thanos Operator onboarding into COO and includes the related issue key. |
    | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- finishing_touch_checkbox_start -->

    <details>
    <summary><strong>✨ Finishing Touches</strong></summary>
    <dl>
    <dd>

    <details>
    <summary><strong>🧪 Generate unit tests (beta)</strong></summary>
    <dl>
    <dd>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests

  • <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch feat/onboard-thanos-operator
  • </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- finishing_touch_checkbox_end -->
    <!-- tips_start -->

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Jul 09, 2026 10:58 UTC
    Code Review
    cmd/operator/main.go:1
    @@ -59,6 +59,7 @@ var defaultImages = map[string]string{
     	"ui-monitoring-pf6":            "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.5.4",
     	"ui-monitoring":                "quay.io/openshift-observability-ui/monitoring-console-plugin:v1.0.0",
     	"perses":                       "quay.io/openshift-observability-ui/perses:v0.54.0",
    +	"thanos-operator":              "quay.io/thanos/thanos-operator:latest",

    _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_

    Replace :latest tag with a pinned version for the thanos-operator image.

    Using :latest is mutable and breaks deployment reproducibility — the image content can change at any time. All other entries in defaultImages use specific version tags or Go constants. Pin to a specific version (e.g., quay.io/thanos/thanos-operator:v0.x.y) to ensure consistent deployments.

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@cmd/operator/main.go` at line 62, The defaultImages entry for
    "thanos-operator" is using a mutable :latest image tag, which should be replaced
    with a pinned version to keep deployments reproducible. Update the
    thanos-operator image in the defaultImages map in main.go to a specific version
    tag consistent with the other pinned images, using the existing
    "thanos-operator" key as the location to change.
    

    </details>

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:80a32abfa8bcfe385dc5c058 -->

    <!-- This is an auto-generated comment by CodeRabbit -->

    ✅ Addressed in commit 58fbb15

    coderabbitai[bot] coderabbitai[bot] commented on code on Jul 09, 2026 10:58 UTC
    Code Review
    deploy/thanos/thanos-operator-cluster-role-binding.yaml:1
    @@ -0,0 +1,14 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRoleBinding
    +metadata:
    +  labels:
    +    app.kubernetes.io/component: controller
    +    app.kubernetes.io/name: thanos-operator
    +  name: thanos-operator
    +roleRef:
    +  apiGroup: rbac.authorization.k8s.io
    +  kind: ClusterRole
    +  name: thanos-operator
    +subjects:
    +- kind: ServiceAccount
    +  name: thanos-operator

    _🩺 Stability & Availability_ | _🔴 Critical_ | _⚡ Quick win_

    Missing namespace on ServiceAccount subject — ClusterRoleBinding is non-functional.

    For kind: ServiceAccount subjects in a ClusterRoleBinding, the namespace field is required. Without it, the binding does not resolve to any ServiceAccount, so the operator pod will lack all granted permissions and fail on every privileged API call. Kustomize's namespace transformer does not inject this field into ClusterRoleBinding subjects, so it must be set explicitly.

    <details>
    <summary>🔧 Proposed fix: add namespace to ServiceAccount subject</summary>

     subjects:
     - kind: ServiceAccount
       name: thanos-operator
    +  namespace: <operator-namespace>
    

    </details>

    If the namespace is dynamic, use a kustomize patch or variable substitution to inject it.

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@deploy/thanos/thanos-operator-cluster-role-binding.yaml` around lines 13 -
    14, The ClusterRoleBinding subject for the thanos-operator ServiceAccount is
    missing the required namespace, so the binding cannot resolve correctly. Update
    the ServiceAccount subject in the ClusterRoleBinding manifest to include an
    explicit namespace, using the thanos-operator binding definition so the role
    maps to the intended ServiceAccount. If the namespace must vary by environment,
    apply it through a kustomize patch or variable substitution rather than relying
    on namespace transformation.
    

    </details>

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:afb6c19c0a9f95669dced05c -->

    <!-- This is an auto-generated comment by CodeRabbit -->

    ✅ Addressed in commits f79810c to f4345ad

    coderabbitai[bot] coderabbitai[bot] commented on code on Jul 09, 2026 10:58 UTC
    Code Review
    deploy/thanos/thanos-operator-deployment.yaml:1
    @@ -0,0 +1,63 @@
    +apiVersion: apps/v1
    +kind: Deployment
    +metadata:
    +  name: thanos-operator
    +  labels:
    +    app.kubernetes.io/component: controller
    +    app.kubernetes.io/name: thanos-operator
    +    app.kubernetes.io/part-of: observability-operator
    +spec:
    +  selector:
    +    matchLabels:
    +      app.kubernetes.io/component: controller
    +      app.kubernetes.io/name: thanos-operator
    +      app.kubernetes.io/part-of: observability-operator
    +  replicas: 1
    +  template:
    +    metadata:
    +      annotations:
    +        kubectl.kubernetes.io/default-container: thanos-operator
    +      labels:
    +        app.kubernetes.io/component: controller
    +        app.kubernetes.io/name: thanos-operator
    +        app.kubernetes.io/part-of: observability-operator
    +    spec:
    +      containers:
    +      - name: thanos-operator
    +        image: quay.io/thanos/thanos-operator:latest
    +        args:
    +        - --leader-elect
    +        - --health-probe-bind-address=:8081
    +        securityContext:
    +          allowPrivilegeEscalation: false
    +          capabilities:
    +            drop:
    +              - "ALL"
    +        livenessProbe:
    +          httpGet:
    +            path: /healthz
    +            port: 8081
    +          initialDelaySeconds: 15
    +          periodSeconds: 20
    +        readinessProbe:
    +          httpGet:
    +            path: /readyz
    +            port: 8081
    +          initialDelaySeconds: 5
    +          periodSeconds: 10
    +        resources:
    +          limits:
    +            cpu: 500m
    +            memory: 512Mi
    +          requests:
    +            cpu: 100m
    +            memory: 128Mi
    +      serviceAccountName: thanos-operator
    +      volumes:
    +      - name: openshift-service-ca
    +        configMap:
    +          name: openshift-service-ca.crt
    +          optional: true
    +          items:
    +          - key: service-ca.crt
    +            path: service-ca.crt

    _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_

    Volume openshift-service-ca is defined but never mounted.

    The pod declares a configmap volume for the OpenShift service CA certificate, but no container in the spec has a corresponding volumeMounts entry. Either the mount is missing (the operator cannot access the CA cert for TLS) or the volume is dead configuration that should be removed.

    <details>
    <summary>🔧 Proposed fix: add volumeMount to container</summary>

           containers:
           - name: thanos-operator
             image: quay.io/thanos/thanos-operator:latest
             args:
             - --leader-elect
             - --health-probe-bind-address=:8081
    +        volumeMounts:
    +        - name: openshift-service-ca
    +          mountPath: /etc/service-ca
    +          readOnly: true
             securityContext:
    

    If the volume is not needed, remove the entire volumes block instead.
    </details>

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 56 - 63, The
    `openshift-service-ca` volume is declared in the Thanos operator deployment but
    never mounted, so either add a matching `volumeMounts` entry on the relevant
    container that needs the CA cert or remove the unused volume block entirely. Use
    the `volumes` definition and the container spec in
    `thanos-operator-deployment.yaml` to keep the config consistent and ensure the
    operator can actually access `service-ca.crt` if TLS support is required.
    

    </details>

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:6df8de8136f01d1fa82e3c6b -->

    <!-- This is an auto-generated comment by CodeRabbit -->

    ✅ Addressed in commits 37f24d0 to 176e144

    coderabbitai[bot] coderabbitai[bot] commented on Jul 09, 2026 10:58 UTC
    Reviewer

    Actionable comments posted: 3

    <details>
    <summary>🧹 Nitpick comments (1)</summary><blockquote>

    <details>
    <summary>deploy/thanos/thanos-operator-deployment.yaml (1)</summary><blockquote>

    24-55: _🔒 Security & Privacy_ | _🔵 Trivial_ | _⚡ Quick win_

    Add pod-level securityContext for defense-in-depth.

    The container-level security context is good (allowPrivilegeEscalation: false, drop ALL capabilities). Adding a pod-level seccompProfile and runAsNonRoot strengthens the posture. Note: on OpenShift, the restricted SCC may already enforce runAsNonRoot, so verify before setting it explicitly.

    <details>
    <summary>🔒 Suggested pod securityContext</summary>

         spec:
    +      securityContext:
    +        runAsNonRoot: true
    +        seccompProfile:
    +          type: RuntimeDefault
           containers:
    

    </details>

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 24 - 55, The
    `thanos-operator` workload only defines a container-level `securityContext`; add
    a pod-level `securityContext` on the `spec` for defense-in-depth. In
    `thanos-operator-deployment.yaml`, update the `spec` for the `thanos-operator`
    deployment to include a pod `seccompProfile` and, if compatible with your
    cluster policy, `runAsNonRoot` alongside the existing `containers` block. Keep
    the existing container `securityContext` as-is and ensure the new pod-level
    settings are applied consistently with OpenShift/SCC behavior.
    

    </details>

    <!-- cr-comment:v1:22c01fc58ad927731e769622 -->

    </blockquote></details>

    </blockquote></details>

    <details>
    <summary>🤖 Prompt for all review comments with AI agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    Inline comments:
    In `@cmd/operator/main.go`:
    - Line 62: The defaultImages entry for "thanos-operator" is using a mutable
    :latest image tag, which should be replaced with a pinned version to keep
    deployments reproducible. Update the thanos-operator image in the defaultImages
    map in main.go to a specific version tag consistent with the other pinned
    images, using the existing "thanos-operator" key as the location to change.
    
    In `@deploy/thanos/thanos-operator-cluster-role-binding.yaml`:
    - Around line 13-14: The ClusterRoleBinding subject for the thanos-operator
    ServiceAccount is missing the required namespace, so the binding cannot resolve
    correctly. Update the ServiceAccount subject in the ClusterRoleBinding manifest
    to include an explicit namespace, using the thanos-operator binding definition
    so the role maps to the intended ServiceAccount. If the namespace must vary by
    environment, apply it through a kustomize patch or variable substitution rather
    than relying on namespace transformation.
    
    In `@deploy/thanos/thanos-operator-deployment.yaml`:
    - Around line 56-63: The `openshift-service-ca` volume is declared in the Thanos
    operator deployment but never mounted, so either add a matching `volumeMounts`
    entry on the relevant container that needs the CA cert or remove the unused
    volume block entirely. Use the `volumes` definition and the container spec in
    `thanos-operator-deployment.yaml` to keep the config consistent and ensure the
    operator can actually access `service-ca.crt` if TLS support is required.
    
    ---
    
    Nitpick comments:
    In `@deploy/thanos/thanos-operator-deployment.yaml`:
    - Around line 24-55: The `thanos-operator` workload only defines a
    container-level `securityContext`; add a pod-level `securityContext` on the
    `spec` for defense-in-depth. In `thanos-operator-deployment.yaml`, update the
    `spec` for the `thanos-operator` deployment to include a pod `seccompProfile`
    and, if compatible with your cluster policy, `runAsNonRoot` alongside the
    existing `containers` block. Keep the existing container `securityContext` as-is
    and ensure the new pod-level settings are applied consistently with
    OpenShift/SCC behavior.
    

    </details>

    <details>
    <summary>🪄 Autofix (Beta)</summary>

    Fix all unresolved CodeRabbit comments on this PR:

  • <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)

  • <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes
  • </details>

    ---

    <details>
    <summary>ℹ️ Review info</summary>

    <details>
    <summary>⚙️ Run configuration</summary>

    Configuration used: Repository YAML (base), Organization UI (inherited)

    Review profile: CHILL

    Plan: Enterprise

    Run ID: b5fd7423-dee8-4305-b2f3-a80cdfdc149a

    </details>

    <details>
    <summary>📥 Commits</summary>

    Reviewing files that changed from the base of the PR and between 8ee6eccfa5ea823644e65909bb0e587f06f38779 and 755fd62f31c2e558f967fc60f3ee73a7582fb441.

    </details>

    <details>
    <summary>⛔ Files ignored due to path filters (1)</summary>

    go.sum is excluded by !/.sum

    </details>

    <details>
    <summary>📒 Files selected for processing (27)</summary>

    Makefile
    cmd/operator/main.go
    deploy/olm/bases/observability-operator.clusterserviceversion.yaml
    deploy/olm/kustomization.yaml
    deploy/thanos/crds/kustomization.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanoscompacts.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosqueries.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosreceives.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosrulers.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosstores.yaml
    deploy/thanos/kustomization.yaml
    deploy/thanos/thanos-operator-cluster-role-binding.yaml
    deploy/thanos/thanos-operator-cluster-role.yaml
    deploy/thanos/thanos-operator-deployment.yaml
    deploy/thanos/thanos-operator-service-account.yaml
    deploy/thanos/thanoscompact_editor_role.yaml
    deploy/thanos/thanoscompact_viewer_role.yaml
    deploy/thanos/thanosquery_editor_role.yaml
    deploy/thanos/thanosquery_viewer_role.yaml
    deploy/thanos/thanosreceive_editor_role.yaml
    deploy/thanos/thanosreceive_viewer_role.yaml
    deploy/thanos/thanosruler_editor_role.yaml
    deploy/thanos/thanosruler_viewer_role.yaml
    deploy/thanos/thanosstore_editor_role.yaml
    deploy/thanos/thanosstore_viewer_role.yaml
    go.mod

  • pkg/operator/scheme.go
  • </details>

    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    coderabbitai[bot] coderabbitai[bot] commented on Jul 09, 2026 12:09 UTC
    Reviewer

    <details>
    <summary>♻️ Duplicate comments (1)</summary><blockquote>

    <details>
    <summary>deploy/thanos/thanos-operator-deployment.yaml (1)</summary><blockquote>

    56-63: _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_

    Volume openshift-service-ca still declared but never mounted.

    The previous review flagged this issue and it remains unresolved: the openshift-service-ca volume is defined but no container in the spec has a corresponding volumeMounts entry. Either add the mount so the operator can access the CA cert, or remove the unused volume block.

    <details>
    <summary>🔧 Proposed fix: add volumeMount to container</summary>

           containers:
           - name: thanos-operator
             image: quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790
             args:
             - --leader-elect
             - --health-probe-bind-address=:8081
    +        volumeMounts:
    +        - name: openshift-service-ca
    +          mountPath: /etc/service-ca
    +          readOnly: true
             securityContext:
    

    </details>

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@deploy/thanos/thanos-operator-deployment.yaml` around lines 56 - 63, The
    openshift-service-ca volume is declared in the deployment spec but never used by
    any container. Update the Thanos operator pod spec so the relevant container
    includes a matching volumeMount for openshift-service-ca, or remove the volume
    block entirely if the CA cert is not needed. Use the existing
    openshift-service-ca volume definition and the container spec in this deployment
    manifest to make the fix consistent.
    

    </details>

    <!-- cr-comment:v1:69c37a0a1d37611c26279f04 -->

    </blockquote></details>

    </blockquote></details>

    <details>
    <summary>🤖 Prompt for all review comments with AI agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    Duplicate comments:
    In `@deploy/thanos/thanos-operator-deployment.yaml`:
    - Around line 56-63: The openshift-service-ca volume is declared in the
    deployment spec but never used by any container. Update the Thanos operator pod
    spec so the relevant container includes a matching volumeMount for
    openshift-service-ca, or remove the volume block entirely if the CA cert is not
    needed. Use the existing openshift-service-ca volume definition and the
    container spec in this deployment manifest to make the fix consistent.
    

    </details>

    ---

    <details>
    <summary>ℹ️ Review info</summary>

    <details>
    <summary>⚙️ Run configuration</summary>

    Configuration used: Repository YAML (base), Organization UI (inherited)

    Review profile: CHILL

    Plan: Enterprise

    Run ID: 11cb96fe-f22d-4bb5-b0fd-15e52a08de8a

    </details>

    <details>
    <summary>📥 Commits</summary>

    Reviewing files that changed from the base of the PR and between 755fd62f31c2e558f967fc60f3ee73a7582fb441 and 58fbb1524f0b1465e31c8544e6369fb110be6ca5.

    </details>

    <details>
    <summary>📒 Files selected for processing (2)</summary>

    cmd/operator/main.go
    deploy/thanos/thanos-operator-deployment.yaml

    </details>

    <details>
    <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

  • cmd/operator/main.go
  • </details>

    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    coderabbitai[bot] coderabbitai[bot] commented on code on Jul 09, 2026 14:20 UTC
    Code Review
    bundle/manifests/observability-operator.clusterserviceversion.yaml:1
    @@ -39,159 +39,98 @@ metadata:
             }
           ]
         capabilities: Basic Install
    -    categories: Monitoring, Observability
    -    certified: "false"
    -    console.openshift.io/operator-monitoring-default: "true"
    -    containerImage: observability-operator:1.5.0
    -    createdAt: "2026-06-23T14:39:10Z"
    -    description: A Go based Kubernetes operator to setup and manage highly available
    -      Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
    -    operatorframework.io/cluster-monitoring: "true"
    -    operatorframework.io/suggested-namespace: observability-operator
    +    createdAt: "2026-07-09T14:10:09Z"
         operators.operatorframework.io/builder: operator-sdk-v1.41.1
    -    operators.operatorframework.io/internal-objects: |-
    -      [
    -        "prometheuses.monitoring.rhobs",
    -        "alertmanagers.monitoring.rhobs",
    -        "thanosrulers.monitoring.rhobs",
    -        "prometheusagents.monitoring.rhobs",
    -        "perses.perses.dev"
    -      ]
         operators.operatorframework.io/project_layout: unknown
    -    repository: https://github.com/rhobs/observability-operator
       name: observability-operator.v1.5.0
       namespace: placeholder
     spec:
       apiservicedefinitions: {}
       customresourcedefinitions:
         owned:
    -    - description: AlertmanagerConfig configures the Prometheus Alertmanager, specifying
    -        how alerts should be grouped, inhibited and notified to external systems
    -      displayName: AlertmanagerConfig
    -      kind: AlertmanagerConfig
    +    - kind: AlertmanagerConfig
           name: alertmanagerconfigs.monitoring.rhobs
           version: v1alpha1
    -    - description: Alertmanager describes an Alertmanager cluster
    -      displayName: Alertmanager
    -      kind: Alertmanager
    +    - kind: Alertmanager
           name: alertmanagers.monitoring.rhobs
           version: v1
    -    - description: MonitoringStack is the Schema for the monitoringstacks API
    -      displayName: MonitoringStack
    -      kind: MonitoringStack
    +    - kind: MonitoringStack
           name: monitoringstacks.monitoring.rhobs
           version: v1alpha1
    -    - description: Provides end-to-end observability capabilities with minimal configuration.
    -        Simplifies deployment and management of observability components such as tracing.
    -      displayName: Observability Installer
    -      kind: ObservabilityInstaller
    +    - kind: ObservabilityInstaller
           name: observabilityinstallers.observability.openshift.io
           version: v1alpha1
         - kind: Perses
           name: perses.perses.dev
           version: v1alpha1
    -    - description: Perses is the Schema for the perses API
    -      displayName: Perses
    -      kind: Perses
    +    - kind: Perses
           name: perses.perses.dev
           version: v1alpha2
         - kind: PersesDashboard
           name: persesdashboards.perses.dev
           version: v1alpha1
    -    - description: A Perses Dashboard
    -      displayName: Perses Dashboard
    -      kind: PersesDashboard
    +    - kind: PersesDashboard
           name: persesdashboards.perses.dev
           version: v1alpha2
         - kind: PersesDatasource
           name: persesdatasources.perses.dev
           version: v1alpha1
    -    - description: A Perses Datasource
    -      displayName: Perses Datasource
    -      kind: PersesDatasource
    +    - kind: PersesDatasource
           name: persesdatasources.perses.dev
           version: v1alpha2
    -    - description: A Perses GlobalDatasource
    -      displayName: Perses GlobalDatasource
    -      kind: PersesGlobalDatasource
    +    - kind: PersesGlobalDatasource
           name: persesglobaldatasources.perses.dev
           version: v1alpha2
    -    - description: PodMonitor defines monitoring for a set of pods
    -      displayName: PodMonitor
    -      kind: PodMonitor
    +    - kind: PodMonitor
           name: podmonitors.monitoring.rhobs
           version: v1
    -    - description: Probe defines monitoring for a set of static targets or ingresses
    -      displayName: Probe
    -      kind: Probe
    +    - kind: Probe
           name: probes.monitoring.rhobs
           version: v1
    -    - description: PrometheusAgent defines a Prometheus agent deployment
    -      displayName: PrometheusAgent
    -      kind: PrometheusAgent
    +    - kind: PrometheusAgent
           name: prometheusagents.monitoring.rhobs
           version: v1alpha1
    -    - description: Prometheus defines a Prometheus deployment
    -      displayName: Prometheus
    -      kind: Prometheus
    +    - kind: Prometheus
           name: prometheuses.monitoring.rhobs
           version: v1
    -    - description: PrometheusRule defines recording and alerting rules for a Prometheus
    -        instance
    -      displayName: PrometheusRule
    -      kind: PrometheusRule
    +    - kind: PrometheusRule
           name: prometheusrules.monitoring.rhobs
           version: v1
    -    - description: ScrapeConfig defines a namespaced Prometheus scrape_config to be
    -        aggregated across multiple namespaces into the Prometheus configuration
    -      displayName: ScrapeConfig
    -      kind: ScrapeConfig
    +    - kind: ScrapeConfig
           name: scrapeconfigs.monitoring.rhobs
           version: v1alpha1
    -    - description: ServiceMonitor defines monitoring for a set of services
    -      displayName: ServiceMonitor
    -      kind: ServiceMonitor
    +    - kind: ServiceMonitor
           name: servicemonitors.monitoring.rhobs
           version: v1
    -    - description: ThanosQuerier outlines the Thanos querier components, managed by
    -        this stack
    -      displayName: ThanosQuerier
    -      kind: ThanosQuerier
    +    - kind: ThanosCompact
    +      name: thanoscompacts.monitoring.thanos.io
    +      version: v1alpha1
    +    - kind: ThanosQuerier
           name: thanosqueriers.monitoring.rhobs
           version: v1alpha1
    -    - description: ThanosRuler defines a ThanosRuler deployment
    -      displayName: ThanosRuler
    -      kind: ThanosRuler
    +    - kind: ThanosQuery
    +      name: thanosqueries.monitoring.thanos.io
    +      version: v1alpha1
    +    - kind: ThanosReceive
    +      name: thanosreceives.monitoring.thanos.io
    +      version: v1alpha1
    +    - kind: ThanosRuler
           name: thanosrulers.monitoring.rhobs
           version: v1
    -    - description: UIPlugin defines a console plugin for observability
    -      displayName: UIPlugin
    -      kind: UIPlugin
    +    - kind: ThanosRuler
    +      name: thanosrulers.monitoring.thanos.io
    +      version: v1alpha1
    +    - kind: ThanosStore
    +      name: thanosstores.monitoring.thanos.io
    +      version: v1alpha1
    +    - kind: UIPlugin
           name: uiplugins.observability.openshift.io
           version: v1alpha1
    -  description: |2+
    -
    -    Observability Operator is a Go based Kubernetes operator to setup and manage highly available Monitoring stack using Prometheus, Alertmanager and Thanos Querier.
    -    ### Supported Features
    -    - Setup multiple Highly Available Monitoring stack using Prometheus, Alertmanager and Thanos Querier
    -    - Customizable configuration for managing Prometheus deployments
    -    - Customizable configuration for managing Alertmanager deployments
    -    - Customizable configuration for managing Thanos Querier deployments
    -    ### Documentation
    -    - **[Documentation](https://github.com/rhobs/observability-operator/tree/main/docs)**
    -    - **[Developer Docs](https://github.com/rhobs/observability-operator/blob/main/docs/developer.md)**
    -    ### Contributing
    -    **[See Contribution Guidelines](https://github.com/rhobs/observability-operator/blob/main/docs/developer.md#contribution-guidelines)** to contribute to the project by
    -    - Raising Bugs and Feature Requests
    -    - Fixing Issues by opening a Pull Request
    -    - Improving Documentation
    -    ###  License
    -    Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
    -
    +  description: Observability Operator description. TODO.

    _📐 Maintainability & Code Quality_ | _🟠 Major_ | _⚡ Quick win_

    Placeholder operator description will ship to OperatorHub.

    description: Observability Operator description. TODO. is a placeholder and becomes the user-facing description in OperatorHub/console. This bundle is generated from deploy/olm/bases/observability-operator.clusterserviceversion.yaml, so fix it there and regenerate.

    Want me to open an issue to track providing real CSV metadata?

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@bundle/manifests/observability-operator.clusterserviceversion.yaml` at line
    129, The CSV still contains a placeholder user-facing description, so update the
    operator description in the source CSV manifest used to generate this bundle and
    regenerate the bundle afterward. Fix the `description` field in
    `observability-operator.clusterserviceversion.yaml` under the OLM base manifest,
    since that is what feeds OperatorHub/console metadata.
    

    </details>

    <!-- fingerprinting:phantom:medusa:capybara -->

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:153f203e16711e6d7d1ed003 -->

    <!-- This is an auto-generated comment by CodeRabbit -->

    ✅ Addressed in commits 516d15d to 0cb4a65

    coderabbitai[bot] coderabbitai[bot] commented on code on Jul 09, 2026 14:20 UTC
    Code Review
    bundle/manifests/observability-operator.clusterserviceversion.yaml:1
    @@ -1227,21 +1353,17 @@ spec:
       - supported: true
         type: AllNamespaces
       keywords:
    -  - observability
    -  - monitoring
    -  - prometheus
    -  - thanos
    +  - observability-operator
       links:
    -  - name: GitHub
    -    url: https://github.com/rhobs/observability-operator
    +  - name: Observability Operator
    +    url: https://observability-operator.domain
       maintainers:
    -  - email: jfajersk@redhat.com
    -    name: Jan Fajerski
    -  - email: spasquie@redhat.com
    -    name: Simon Pasquier
    +  - email: your@email.com
    +    name: Maintainer Name
       maturity: alpha
       provider:
    -    name: Red Hat
    +    name: Provider Name
    +    url: https://your.domain

    _📐 Maintainability & Code Quality_ | _🟠 Major_ | _⚡ Quick win_

    Placeholder maintainer/provider/links metadata in the shipped bundle.

    your@email.com, Maintainer Name, Provider Name, https://your.domain, and https://observability-operator.domain are template defaults. Per the change summary this replaced the prior GitHub/Red Hat information, so this is a regression in the published CSV metadata. Restore the real values in the base CSV (deploy/olm/bases/observability-operator.clusterserviceversion.yaml) and regenerate the bundle.

    <details>
    <summary>🤖 Prompt for AI Agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    In `@bundle/manifests/observability-operator.clusterserviceversion.yaml` around
    lines 1356 - 1366, The shipped CSV metadata still contains template placeholders
    for the maintainer, provider, and link fields. Update the source CSV in
    deploy/olm/bases/observability-operator.clusterserviceversion.yaml to restore
    the real maintainer/provider/link values, then regenerate the bundle so
    observability-operator.clusterserviceversion.yaml picks up the correct metadata.
    

    </details>

    <!-- fingerprinting:phantom:medusa:capybara -->

    <!-- cr-indicator-types:potential_issue -->

    <!-- cr-comment:v1:fa52f3300dc7af8f9df099f8 -->

    <!-- This is an auto-generated comment by CodeRabbit -->

    ✅ Addressed in commits 516d15d to 0cb4a65

    coderabbitai[bot] coderabbitai[bot] commented on Jul 09, 2026 14:20 UTC
    Reviewer

    Actionable comments posted: 2

    <details>
    <summary>🤖 Prompt for all review comments with AI agents</summary>

    Verify each finding against current code. Fix only still-valid issues, skip the
    rest with a brief reason, keep changes minimal, and validate.
    
    Inline comments:
    In `@bundle/manifests/observability-operator.clusterserviceversion.yaml`:
    - Line 129: The CSV still contains a placeholder user-facing description, so
    update the operator description in the source CSV manifest used to generate this
    bundle and regenerate the bundle afterward. Fix the `description` field in
    `observability-operator.clusterserviceversion.yaml` under the OLM base manifest,
    since that is what feeds OperatorHub/console metadata.
    - Around line 1356-1366: The shipped CSV metadata still contains template
    placeholders for the maintainer, provider, and link fields. Update the source
    CSV in deploy/olm/bases/observability-operator.clusterserviceversion.yaml to
    restore the real maintainer/provider/link values, then regenerate the bundle so
    observability-operator.clusterserviceversion.yaml picks up the correct metadata.
    

    </details>

    <details>
    <summary>🪄 Autofix (Beta)</summary>

    Fix all unresolved CodeRabbit comments on this PR:

  • <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)

  • <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes
  • </details>

    ---

    <details>
    <summary>ℹ️ Review info</summary>

    <details>
    <summary>⚙️ Run configuration</summary>

    Configuration used: Repository YAML (base), Organization UI (inherited)

    Review profile: CHILL

    Plan: Enterprise

    Run ID: 766f27ad-7336-428f-9b4f-9c87ac0aeee9

    </details>

    <details>
    <summary>📥 Commits</summary>

    Reviewing files that changed from the base of the PR and between 58fbb1524f0b1465e31c8544e6369fb110be6ca5 and f3a68ea3e7350a7f232e8df410ca206363fc55b0.

    </details>

    <details>
    <summary>📒 Files selected for processing (25)</summary>

    Makefile
    bundle.Dockerfile
    bundle/manifests/monitoring.thanos.io_thanoscompacts.yaml
    bundle/manifests/monitoring.thanos.io_thanosqueries.yaml
    bundle/manifests/monitoring.thanos.io_thanosreceives.yaml
    bundle/manifests/monitoring.thanos.io_thanosrulers.yaml
    bundle/manifests/monitoring.thanos.io_thanosstores.yaml
    bundle/manifests/observability-operator.clusterserviceversion.yaml
    bundle/manifests/thanoscompact-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanoscompact-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosquery-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosquery-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosreceive-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosreceive-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosruler-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosruler-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosstore-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosstore-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/metadata/annotations.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanoscompacts.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosqueries.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosreceives.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosrulers.yaml
    deploy/thanos/crds/monitoring.thanos.io_thanosstores.yaml
    deploy/thanos/thanos-operator-deployment.yaml

    </details>

    <details>
    <summary>💤 Files with no reviewable changes (1)</summary>

    deploy/thanos/thanos-operator-deployment.yaml

    </details>

    <details>
    <summary>✅ Files skipped from review due to trivial changes (3)</summary>

    bundle/manifests/thanosstore-viewer-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/manifests/thanosruler-editor-role_rbac.authorization.k8s.io_v1_clusterrole.yaml
    bundle/metadata/annotations.yaml

    </details>

    <details>
    <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

    Makefile

    </details>

    </details>

    <!-- This is an auto-generated comment by CodeRabbit for review status -->

    openshift-ci-robot openshift-ci-robot commented on Jul 09, 2026 15:06 UTC
    Contributor

    @coleenquadros: This pull request references ACM-37236 which is a valid jira issue.

    Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

    <details>

    In response to this:

    >## Summary

    >Onboard the Thanos Operator into COO following the same pattern as the Perses operator onboarding.

    >- Add deploy/thanos/ directory with 5 CRDs (monitoring.thanos.io/v1alpha1), operator deployment, RBAC, and user-facing editor/viewer roles

    >- Wire into OLM bundle via deploy/olm/kustomization.yaml
    >- Register Thanos CRDs as owned in the CSV
    >- Add Go dependency on github.com/thanos-community/thanos-operator and register types in scheme
    >- Add generate-thanos-op-crds Makefile target
    >- Add default thanos-operator image in cmd/operator/main.go
    >### CRDs added

    >| Kind | API Group | Scope |

    >|---|---|---|
    >| ThanosQuery | monitoring.thanos.io | Namespaced |
    >| ThanosReceive | monitoring.thanos.io | Namespaced |
    >| ThanosCompact | monitoring.thanos.io | Namespaced |
    >| ThanosStore | monitoring.thanos.io | Namespaced |
    >| ThanosRuler | monitoring.thanos.io | Namespaced |
    >API support level: TechPreviewNoUpgrade

    >### Pattern followed

    >Same as Perses operator onboarding (commit 5ba0330):

    >- Local CRD files with kustomize annotations
    >- Dedicated deployment, service account, cluster role
    >- User-facing editor/viewer ClusterRoles per CRD
    >- Types registered in pkg/operator/scheme.go under OpenShift feature gate
    >Jira: ACM-37236

    >## Test plan

    >- [x] go build ./... passes

    >- [x] kustomize build deploy/olm/ renders all Thanos resources correctly
    >- [x] go test ./... unit tests pass (e2e skipped — requires live cluster)
    >- [ ] Deploy to test cluster and verify CRDs are created
    >🤖 Generated with Claude Code

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
    </details>

    danielmellado danielmellado commented on code on Jul 15, 2026 09:15 UTC
    Code Review
    go.mod:1
    @@ -131,6 +133,7 @@ require (
     	github.com/spf13/cobra v1.10.2 // indirect
     	github.com/spf13/pflag v1.0.10 // indirect
     	github.com/stretchr/objx v0.5.2 // indirect
    +	github.com/thanos-community/thanos-operator v0.0.0-20260702133656-54890f01eac9 // indirect

    github.com/thanos-community/thanos-operator is marked // indirect, but it's imported directly in pkg/operator/scheme.go (line 15). A go mod tidy should move it to the direct dependencies block.

    danielmellado danielmellado commented on code on Jul 15, 2026 09:17 UTC
    Code Review
    deploy/thanos/thanos-operator-cluster-role.yaml:1
    @@ -0,0 +1,125 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRole
    +metadata:
    +  name: thanos-operator
    +rules:
    +- apiGroups:
    +  - ""
    +  resources:
    +  - configmaps
    +  - persistentvolumeclaims
    +  - secrets
    +  - serviceaccounts
    +  - services
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - apps
    +  resources:
    +  - deployments
    +  - statefulsets
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - discovery.k8s.io
    +  resources:
    +  - endpointslices
    +  verbs:
    +  - get
    +  - list
    +  - watch
    +- apiGroups:
    +  - monitoring.coreos.com
    +  resources:
    +  - prometheusrules
    +  verbs:
    +  - get
    +  - list
    +  - watch
    +- apiGroups:
    +  - monitoring.coreos.com
    +  resources:
    +  - servicemonitors
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts
    +  - thanosqueries
    +  - thanosreceives
    +  - thanosrulers
    +  - thanosstores
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts/finalizers
    +  - thanosqueries/finalizers
    +  - thanosreceives/finalizers
    +  - thanosrulers/finalizers
    +  - thanosstores/finalizers
    +  verbs:
    +  - update
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts/status
    +  - thanosqueries/status
    +  - thanosreceives/status
    +  - thanosrulers/status
    +  - thanosstores/status
    +  verbs:
    +  - get
    +  - patch
    +  - update
    +- apiGroups:
    +  - policy
    +  resources:
    +  - poddisruptionbudgets
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - rbac.authorization.k8s.io
    +  resources:
    +  - rolebindings
    +  - roles
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch

    The deployment passes --leader-elect (see thanos-operator-deployment.yaml:29), but this ClusterRole is missing permissions for coordination.k8s.io/leases. Since controller-runtime v0.19+ defaults to lease-based leader election, the operator pod may crash-loop with a forbidden error on startup.

    danielmellado danielmellado commented on code on Jul 15, 2026 09:18 UTC
    Code Review
    deploy/thanos/thanos-operator-cluster-role.yaml:1
    @@ -0,0 +1,125 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRole
    +metadata:
    +  name: thanos-operator
    +rules:
    +- apiGroups:
    +  - ""
    +  resources:
    +  - configmaps
    +  - persistentvolumeclaims
    +  - secrets
    +  - serviceaccounts
    +  - services
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch

    Controllers need to emit Kubernetes events for status updates. The Perses ClusterRole includes events in the core API group. This one does not and I assume it's not inteded. Please let me know otherwise!. If not, the operator will log warnings or fail to record events at runtime.

    I'd add events to the core API group resources, or as a separate rule:

    danielmellado danielmellado commented on code on Jul 15, 2026 09:23 UTC
    Code Review
    deploy/thanos/thanos-operator-deployment.yaml:1
    @@ -0,0 +1,55 @@
    +apiVersion: apps/v1
    +kind: Deployment
    +metadata:
    +  name: thanos-operator
    +  labels:
    +    app.kubernetes.io/component: controller
    +    app.kubernetes.io/name: thanos-operator
    +    app.kubernetes.io/part-of: observability-operator
    +spec:
    +  selector:
    +    matchLabels:
    +      app.kubernetes.io/component: controller
    +      app.kubernetes.io/name: thanos-operator
    +      app.kubernetes.io/part-of: observability-operator
    +  replicas: 1
    +  template:
    +    metadata:
    +      annotations:
    +        kubectl.kubernetes.io/default-container: thanos-operator
    +      labels:
    +        app.kubernetes.io/component: controller
    +        app.kubernetes.io/name: thanos-operator
    +        app.kubernetes.io/part-of: observability-operator
    +    spec:
    +      containers:
    +      - name: thanos-operator
    +        image: quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790

    main-2026-07-02-e6d1790 is a nightly build from main, not a release tag. This is fine for TechPreview, but we should track switching to a proper release tag before moving toward GA. Is there a released version of thanos-operator we can pin to already?

    danielmellado danielmellado commented on code on Jul 15, 2026 09:24 UTC
    Code Review
    cmd/operator/main.go:1
    @@ -59,6 +59,7 @@ var defaultImages = map[string]string{
     	"ui-monitoring-pf6":            "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.5.4",
     	"ui-monitoring":                "quay.io/openshift-observability-ui/monitoring-console-plugin:v1.0.0",
     	"perses":                       "quay.io/openshift-observability-ui/perses:v0.54.0",
    +	"thanos-operator":              "quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790",

    nit: Same dev tag note as on the deployment YAML.

    danielmellado danielmellado requested changes on Jul 15, 2026 09:26 UTC
    Changes Requested Reviewer

    Overall this LGTM, but I think that there may be a few issues. See inline comments. Thanks!

    simonpasquier simonpasquier commented on Jul 15, 2026 09:39 UTC
    Contributor

    We have future work (https://redhat.atlassian.net/browse/COO-1969) to remove all second-level operators (e.g. Prometheus, Perses, ...) from the OLM CSV because it proved to be too inflexible. I suggest that we apply this decision to Thanos in advance.

    coleenquadros coleenquadros commented on code on Jul 15, 2026 13:32 UTC
    Code Review
    deploy/thanos/thanos-operator-cluster-role.yaml:1
    @@ -0,0 +1,125 @@
    +apiVersion: rbac.authorization.k8s.io/v1
    +kind: ClusterRole
    +metadata:
    +  name: thanos-operator
    +rules:
    +- apiGroups:
    +  - ""
    +  resources:
    +  - configmaps
    +  - persistentvolumeclaims
    +  - secrets
    +  - serviceaccounts
    +  - services
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - apps
    +  resources:
    +  - deployments
    +  - statefulsets
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - discovery.k8s.io
    +  resources:
    +  - endpointslices
    +  verbs:
    +  - get
    +  - list
    +  - watch
    +- apiGroups:
    +  - monitoring.coreos.com
    +  resources:
    +  - prometheusrules
    +  verbs:
    +  - get
    +  - list
    +  - watch
    +- apiGroups:
    +  - monitoring.coreos.com
    +  resources:
    +  - servicemonitors
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts
    +  - thanosqueries
    +  - thanosreceives
    +  - thanosrulers
    +  - thanosstores
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts/finalizers
    +  - thanosqueries/finalizers
    +  - thanosreceives/finalizers
    +  - thanosrulers/finalizers
    +  - thanosstores/finalizers
    +  verbs:
    +  - update
    +- apiGroups:
    +  - monitoring.thanos.io
    +  resources:
    +  - thanoscompacts/status
    +  - thanosqueries/status
    +  - thanosreceives/status
    +  - thanosrulers/status
    +  - thanosstores/status
    +  verbs:
    +  - get
    +  - patch
    +  - update
    +- apiGroups:
    +  - policy
    +  resources:
    +  - poddisruptionbudgets
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch
    +- apiGroups:
    +  - rbac.authorization.k8s.io
    +  resources:
    +  - rolebindings
    +  - roles
    +  verbs:
    +  - create
    +  - delete
    +  - get
    +  - list
    +  - patch
    +  - update
    +  - watch

    Thanks for pointing it out. Totally missed the role and rolebinding for this from my POC PR

    openshift-ci[bot] openshift-ci[bot] commented on Jul 15, 2026 13:34 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: <a href="https://github.com/rhobs/observability-operator/pull/1151#" title="Author self-approved">coleenquadros</a>
    Once this PR has been reviewed and has the lgtm label, please ask for approval from danielmellado. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["danielmellado"]} -->

    coderabbitai[bot] coderabbitai[bot] commented on Jul 15, 2026 13:40 UTC
    Bot

    [!CAUTION]

    Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

    > <details>

    <summary>Error details</summary>

    >
    > putComment timed out
    > 

    > </details>

    coleenquadros coleenquadros commented on code on Jul 15, 2026 13:45 UTC
    Code Review
    deploy/thanos/thanos-operator-deployment.yaml:1
    @@ -0,0 +1,55 @@
    +apiVersion: apps/v1
    +kind: Deployment
    +metadata:
    +  name: thanos-operator
    +  labels:
    +    app.kubernetes.io/component: controller
    +    app.kubernetes.io/name: thanos-operator
    +    app.kubernetes.io/part-of: observability-operator
    +spec:
    +  selector:
    +    matchLabels:
    +      app.kubernetes.io/component: controller
    +      app.kubernetes.io/name: thanos-operator
    +      app.kubernetes.io/part-of: observability-operator
    +  replicas: 1
    +  template:
    +    metadata:
    +      annotations:
    +        kubectl.kubernetes.io/default-container: thanos-operator
    +      labels:
    +        app.kubernetes.io/component: controller
    +        app.kubernetes.io/name: thanos-operator
    +        app.kubernetes.io/part-of: observability-operator
    +    spec:
    +      containers:
    +      - name: thanos-operator
    +        image: quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790

    thanos-community/thanos-operator has no tags or GitHub releases yet. Rhobs next points to nightly too I think @saswatamcode or @philipgough would be able to confirm

    jan--f jan--f commented on code on Jul 24, 2026 11:14 UTC
    Code Review
    deploy/thanos/thanos-operator-deployment.yaml:1
    @@ -0,0 +1,55 @@
    +apiVersion: apps/v1
    +kind: Deployment
    +metadata:
    +  name: thanos-operator
    +  labels:
    +    app.kubernetes.io/component: controller
    +    app.kubernetes.io/name: thanos-operator
    +    app.kubernetes.io/part-of: observability-operator
    +spec:
    +  selector:
    +    matchLabels:
    +      app.kubernetes.io/component: controller
    +      app.kubernetes.io/name: thanos-operator
    +      app.kubernetes.io/part-of: observability-operator
    +  replicas: 1
    +  template:
    +    metadata:
    +      annotations:
    +        kubectl.kubernetes.io/default-container: thanos-operator
    +      labels:
    +        app.kubernetes.io/component: controller
    +        app.kubernetes.io/name: thanos-operator
    +        app.kubernetes.io/part-of: observability-operator
    +    spec:
    +      containers:
    +      - name: thanos-operator
    +        image: quay.io/thanos/thanos-operator:main-2026-07-02-e6d1790

    This is fine for upstream. Downstream we replace those image links anyway.

    jan--f jan--f commented on Jul 24, 2026 11:17 UTC
    Contributor

    We have future work (https://redhat.atlassian.net/browse/COO-1969) to remove all second-level operators (e.g. Prometheus, Perses, ...) from the OLM CSV because it proved to be too inflexible. I suggest that we apply this decision to Thanos in advance.

    I thought about the same, but I perhaps its better to not delay/block the thanos addition on that? We don't have a fix for all issues the bundle removal will cause and I doubt adding yet another operator to migrate adds significant overhead.

    That is unless Coleen is interested in the work needed for COO-1969. I'd be happy to have this here, though I wouldn't want to block this on COO-1969.

    jan--f jan--f requested changes on Aug 05, 2026 12:05 UTC
    Changes Requested Reviewer

    Overall this lgtm, except for one nit:
    Some RBAC releated resources specify namespace: default, but the operator deployment doesn't. Given that there might a leader election iiuc this could fail if someone deploys via the kustomization file. The operator deployment could end up in a different namespace then the SA and CRB allowing the leader election.
    The easiest would be to set a namespace in kustomization.yaml
    We do this for prometheus operator here:
    https://github.com/rhobs/observability-operator/blob/27dfbb99c794941ece618dfae51516daf89b1438/deploy/dependencies/kustomization.yaml#L42

    openshift-ci[bot] openshift-ci[bot] commented on Oct 31, 2026 05:59 UTC
    Bot

    PR needs rebase.

    <details>

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
    </details>

    Reviewers
    Assignees
    coleenquadros coleenquadros
    Labels
    risk: low confidence: 75.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 78.5% (HIGH) · Higher = larger blast radius
    78.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 75.1% · Lower = rushed or shallow review
    75.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%