Skip to content

replicalimits unit tests do not include checks for Scale resources #419

Description

@skaven81

The general/replicalimits ConstraintTemplate in the library only has unit tests that validate updates to a Deployment resource. It does not check for Scale resources, which get generated when running kubectl scale commands.

There is also a bug in the Rego because in the event of kubectl scale deploy <name> --replicas=0, the Scale resource has an empty spec (so input.review.object.spec is empty) and a violation is generated, even if a range allows zero as a valid value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions