-
-
Notifications
You must be signed in to change notification settings - Fork 364
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-impling 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
kubeinvariants kubeinvariants exposed to the application (for example: any object to be created on the apiserver must have a non-empty.metadata.namexor.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:
Podwill 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
Labels
Type
Projects
Status