Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joelanford opened this issue Feb 10, 2023 · 0 comments · Fixed by #138
Closed

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

joelanford opened this issue Feb 10, 2023 · 0 comments · Fixed by #138

Comments

@joelanford
Copy link
Member

joelanford commented Feb 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant