Merge pull request #44141 from k82cn/ss_typo

Automatic merge from submit-queue (batch tested with PRs 43373, 41780, 44141, 43914, 44180)

Updated comments according to the logic.

Updated comments according to the logic: it'll return empty string instead of nil if failed to match the regex.
This commit is contained in:
Kubernetes Submit Queue 2017-04-07 09:57:39 -07:00 committed by GitHub
commit 97c38377f3

View File

@ -56,8 +56,8 @@ func (o overlappingStatefulSets) Less(i, j int) bool {
var statefulPodRegex = regexp.MustCompile("(.*)-([0-9]+)$")
// getParentNameAndOrdinal gets the name of pod's parent StatefulSet and pod's ordinal as extracted from its Name. If
// the Pod was not created by a StatefulSet, its parent is considered to be nil, and its ordinal is considered to be
// -1.
// the Pod was not created by a StatefulSet, its parent is considered to be empty string, and its ordinal is considered
// to be -1.
func getParentNameAndOrdinal(pod *v1.Pod) (string, int) {
parent := ""
ordinal := -1