Skip to content

The resolver should treat certain properties/constraints as optional #123

@joelanford

Description

@joelanford

See https://kubernetes.slack.com/archives/C0181L6JYQ2/p1675349508746979

TL;DR: We should pass a boolean value to loadFromEntity to indicate whether the property is required (true) or optional (false). Currently the function is implemented as if everything it is asked to load is required.

If this new parameter is optional/false and the property name is not in the map, we should return the default value of the type and a nil error.

Lastly, instead of using true/false at call sites, @perdasilva suggested we define constants (perhaps required, optional = true, false), and then use the constant at call sites to make it more obvious what the semantics of the boolean value are.

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