type PatchTarget … type PatchManager … type patchSet … // String() is used for unit-testing. func (ps *patchSet) String() string { … } const KubeletConfiguration … const CoreDNSDeployment … var pathLock … var pathCache … var patchTypes … var patchTypeList … var patchTypesJoined … var knownExtensions … var regExtension … var knownTargets … // KnownTargets returns the locally defined knownTargets. func KnownTargets() []string { … } // GetPatchManagerForPath creates a patch manager that can be used to apply patches to "knownTargets". // "path" should contain patches that can be used to patch the "knownTargets". // If "output" is non-nil, messages about actions performed by the manager would go on this io.Writer. func GetPatchManagerForPath(path string, knownTargets []string, output io.Writer) (*PatchManager, error) { … } // ApplyPatchesToTarget takes a patch target and patches its "Data" using the patches // stored in the patch manager. The resulted "Data" is always converted to JSON. func (pm *PatchManager) ApplyPatchesToTarget(patchTarget *PatchTarget) error { … } // parseFilename validates a file name and retrieves the encoded target name and patch type. // - On unknown extension or target name it returns a warning // - On unknown patch type it returns an error // - On success it returns a target name and patch type func parseFilename(fileName string, knownTargets []string) (string, types.PatchType, error, error) { … } // createPatchSet creates a patchSet object, by splitting the given "data" by "\n---". func createPatchSet(targetName string, patchType types.PatchType, data string) (*patchSet, error) { … } // getPatchSetsFromPath walks a path, ignores sub-directories and non-patch files, and // returns a list of patchFile objects. func getPatchSetsFromPath(targetPath string, knownTargets []string, output io.Writer) ([]*patchSet, []string, []string, error) { … }