func findNameStep(parts []string, typeOptions sets.String) string {
	if len(parts) == 0 {
		return ""
	}
	numberOfPartsInStep := findKnownValue(parts[1:], typeOptions) + 1
	if numberOfPartsInStep == 0 {
		numberOfPartsInStep = len(parts)
	}
	nextParts := parts[0:numberOfPartsInStep]
	return strings.Join(nextParts, ".")
}
findNameStep takes the list of parts and a set of valid tags that can be used after the name.  It then walks the list of parts
until it find a valid "next" tag or until it reaches the end of the parts and then builds the name back up out of the individual parts
package config
import (
	"fmt"
	"reflect"
	"strings"
	clientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api"
	"k8s.io/kubernetes/pkg/util/sets"
)
type navigationSteps struct {
	steps            []navigationStep
	currentStepIndex int
}
type navigationStep struct {
	stepValue string
	stepType  reflect.Type
}
func newNavigationSteps(path string) (*navigationSteps, error) {
	steps := []navigationStep{}
	individualParts := strings.Split(path, ".")
	currType := reflect.TypeOf(clientcmdapi.Config{})
	currPartIndex := 0
	for currPartIndex < len(individualParts) {
		switch currType.Kind() {
		case reflect.Map:
			mapValueType := currType.Elem().Elem()
			mapValueOptions, err := getPotentialTypeValues(mapValueType)
			if err != nil {
				return nil, err
			}
			nextPart := findNameStep(individualParts[currPartIndex:], sets.StringKeySet(mapValueOptions))
			steps = append(steps, navigationStep{nextPart, mapValueType})
			currPartIndex += len(strings.Split(nextPart, "."))
			currType = mapValueType
		case reflect.Struct:
			nextPart := individualParts[currPartIndex]
			options, err := getPotentialTypeValues(currType)
			if err != nil {
				return nil, err
			}
			fieldType, exists := options[nextPart]
			if !exists {
				return nil, fmt.Errorf("unable to parse %v after %v at %v", path, steps, currType)
			}
			steps = append(steps, navigationStep{nextPart, fieldType})
			currPartIndex += len(strings.Split(nextPart, "."))
			currType = fieldType
		}
	}
	return &navigationSteps{steps, 0}, nil
}
func (s *navigationSteps) pop() navigationStep {
	if s.moreStepsRemaining() {
		s.currentStepIndex++
		return s.steps[s.currentStepIndex-1]
	}
	return navigationStep{}
}
func (s *navigationSteps) peek() navigationStep {
	if s.moreStepsRemaining() {
		return s.steps[s.currentStepIndex]
	}
	return navigationStep{}
}
func (s *navigationSteps) moreStepsRemaining() bool {
	return len(s.steps) > s.currentStepIndex
}