Skip to content

check-rules update does not support PrometheusRule CRD files #110

@mmanciop

Description

@mmanciop

Problem

dash0 check-rules update -f <file> fails when the file is a PrometheusRule CRD:

$ dash0 check-rules update -f otel-collector-export-failures.yaml
Error: no check rule ID provided as argument, and the file does not contain an ID

The file contains a valid dash0.com/id label in metadata.labels, but the update command reads the file directly into a PrometheusAlertRule struct without detecting the kind first. The ID in a PrometheusRule CRD is stored in metadata.labels["dash0.com/id"], not in a top-level id field, so it is silently lost.

Both apply and check-rules create handle PrometheusRule CRDs correctly by detecting the kind and routing to the appropriate parser.

Expected behavior

check-rules update should accept PrometheusRule CRD files, matching the behavior of apply and check-rules create. For update, the CRD must contain exactly one alerting rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions