Skip to content

Scalers Should Use Numeric Types for Thresholds and Values #2299

@isugimpy

Description

@isugimpy

Proposal

It would be nice to have threshold and value fields accept plain numeric or integer values for scaling. To retain backwards compatibility both strings which parse as numbers and actual numeric types could be allowed, if that's feasible in openAPIv3.

Use-Case

YAML libraries are well known to cast values to different types based on how they look. Because of this, even when providing a quoted value to force an integer to be a string (or even with the YAML !!str type hint), if a ScaledObject goes through any form of parsing or mutation (a great example being a GitOps workflow tool such as Flux, or passing through Kustomize), the YAML parser sees the value, assumes it should be an integer, and outputs it as one, causing apply failures due to the spec being incorrect. Allowing plain numeric/integer values would help with this considerably.

Additionally, requiring string types for numeric values is counterintuitive to users, so this would be a win for user experience.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestAll issues for new features that have not been committed toneeds-discussionstaleAll issues that are marked as stale due to inactivity

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions