Skip to content

Query: Stable way to compare spec #3222

Open
@Anuragch

Description

@Anuragch

Hi all,

My CRD controller manages a variety of child resources. During reconciliation, I compare the current spec against the desired state. However, some fields are stored in a different format by Kubernetes – for example, CPU values. If the user specifies 0.2, Kubernetes stores it as 200m, causing unnecessary event churn.

I could preprocess these values in my spec before applying, but is this a sustainable and reliable approach? This issue isn't limited to CPU – memory limits and potentially other fields may also be affected.

Would using a predicate for spec comparison be more reliable in such cases? How do you handle these formatting discrepancies effectively?

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