// findPatcher returns a groupVersion string and a patch function for the
// specified kind.  This is needed because, at least in theory, the schema of a
// resource could change dramatically, and we should use statically versioned
// types everywhere.  In practice, it's unlikely that the bits we care about
// would change (since we PATCH).  Alas, there's not a great way to dynamically
// use whatever is "latest".  The fallout of this is that we will need to update
// this program when new API group-versions are introduced.
findPatcher returns a groupVersion string and a patch function for the
specified kind.  This is needed because, at least in theory, the schema of a
resource could change dramatically, and we should use statically versioned
types everywhere.  In practice, it's unlikely that the bits we care about
would change (since we PATCH).  Alas, there's not a great way to dynamically
use whatever is "latest".  The fallout of this is that we will need to update
this program when new API group-versions are introduced.
// findPatcher returns a groupVersion string and a patch function for the // specified kind . This is needed because at least in theory the schema of a // resource could change dramatically and we should use statically versioned // types everywhere . In practice it ' s unlikely that the bits we care about // would change ( since we PATCH ) . Alas there ' s not a great way to dynamically // use whatever is " latest " . The fallout of this is that we will need to update // this program when new API group - versions are introduced .
func findPatcher(kind string, groupVersions map[string]bool) (string, patchFunc, error) {
	switch strings.ToLower(kind) {
	case "deployment":
		return findDeploymentPatcher(groupVersions)
	case "daemonset":
		return findDaemonSetPatcher(groupVersions)
	case "replicaset":
		return findReplicaSetPatcher(groupVersions)
	}
	return "", nil, fmt.Errorf("unknown target kind: %s", kind)
}
func findPatcher ( kind string , groupVersions map [ string ] bool ) ( string , patchFunc , error ) { switch strings . ToLower ( kind ) { case " " : return findDeploymentPatcher ( groupVersions ) case " " : return findDaemonSetPatcher ( groupVersions ) case " " : return findReplicaSetPatcher ( groupVersions ) } return " " , nil , fmt . Errorf ( " " , kind ) }
findPatcher returns a groupVersion string and a patch function for the
specified kind.
findPatcher returns a groupVersion string and a patch function for the specified kind .
// This should not happen, we already validated it.