func recordEvents(events []watch.Event, f func(watch.Event) (bool, error)) func(watch.Event) (bool, error) { … } type invariantFunc … // checkInvariants checks for invariant of the each events. func checkInvariants(events []watch.Event, fns ...invariantFunc) error { … } // containerInitInvariant checks for an init containers are initialized and invariant on both older and newer. func containerInitInvariant(older, newer runtime.Object) error { … } // initialized checks the state of all init containers in the pod. func initialized(pod *v1.Pod) (ok bool, failed bool, err error) { … } func initContainersInvariants(pod *v1.Pod) error { … } var _ … // toDebugJSON converts an object to its JSON representation for debug logging // purposes instead of using a struct. func toDebugJSON(obj interface{ … }