Description
Currently, we have a bunch of helpers that can implicitly panic the program when their invariants aren't upheld externally, such as ResourceExt::name
. These essentially allow the apiserver (or any other source of Resource
-impl
ing objects) to panic the whole process.
Are these a good idea to encourage? Should we at least ban their transitive usage within the core kube
crates?
If we do keep them around, we should probably at the very least document a policy for which invariants should be allowed to cause kube
to panic. For example, it's worth considering (in escalating order of exposure):
- private
kube
invariants kube
invariants exposed to the application (for example: any object to be created on the apiserver must have a non-empty.metadata.name
xor.metadata.generate_name
)- apiserver invariants (for example: any object returned by the apiserver must have a non-empty
.metadata.name
) - object-level expectations (for example:
Pod
will pretty much always have >=1 container)
Currently we don't really have a strong policy on this (or we wouldn't need this issue), but in general we've been leaning towards 3 being the limit for when we're allowed to panic.
Metadata
Metadata
Assignees
Type
Projects
Status