Enabling drift detection causing the rancher-monitoring-prometheus to fail on dry-run

When working on !2445 (merged), it was noticed that when drift detection and correction was enabled, rancher-monitoring-prometheus dry-run was getting failed as there were some fields which were declared incorrectly in the prometheus spec.

Below is the snippets of the errors noticed:

Status:
  Conditions:
    Last Transition Time:  2024-10-28T21:33:13Z
    Message:               Fulfilling prerequisites
    Observed Generation:   1
    Reason:                Progressing
    Status:                True
    Type:                  Reconciling
    Last Transition Time:  2024-10-29T07:31:44Z
    Message:               Could not determine release state: unable to determine cluster state: Prometheus/cattle-monitoring-system/rancher-monitoring-prometheus dry-run failed: failed to create typed patch object (cattle-monitoring-system/rancher-monitoring-prometheus; monitoring.coreos.com/v1, Kind=Prometheus): errors:
  .spec.remoteWrite[0].queue_config: field not declared in schema
  .spec.resources.request: field not declared in schema
    Message:               Could not determine release state: unable to determine cluster state: Prometheus/cattle-monitoring-system/rancher-monitoring-prometheus dry-run failed: failed to create typed patch object (cattle-monitoring-system/rancher-monitoring-prometheus; monitoring.coreos.com/v1, Kind=Prometheus): .spec.remoteWrite[0].queueConfig.batch_send_deadline: field not declared in schema
    Message:               Could not determine release state: unable to determine cluster state: Prometheus/cattle-monitoring-system/rancher-monitoring-prometheus dry-run failed: failed to create typed patch object (cattle-monitoring-system/rancher-monitoring-prometheus; monitoring.coreos.com/v1, Kind=Prometheus): .spec.remoteWrite[0].queueConfig.max_backoff: field not declared in schema
    Message:               Could not determine release state: unable to determine cluster state: Prometheus/cattle-monitoring-system/rancher-monitoring-prometheus dry-run failed: failed to create typed patch object (cattle-monitoring-system/rancher-monitoring-prometheus; monitoring.coreos.com/v1, Kind=Prometheus): .spec.remoteWrite[0].queueConfig.min_backoff: field not declared in schema

Also see the comment: !2445 (comment 2072872357)

Edited Oct 29, 2024 by Ishita Mittal
Assignee Loading
Time tracking Loading