Updated comments according to the logic.

This commit is contained in:
Klaus Ma 2017-04-06 16:32:42 +08:00
parent 8667d7c4f1
commit c8e6c2eecd

View File

@ -56,8 +56,8 @@ func (o overlappingStatefulSets) Less(i, j int) bool {
var statefulPodRegex = regexp.MustCompile("(.*)-([0-9]+)$") 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 // 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 // the Pod was not created by a StatefulSet, its parent is considered to be empty string, and its ordinal is considered
// -1. // to be -1.
func getParentNameAndOrdinal(pod *v1.Pod) (string, int) { func getParentNameAndOrdinal(pod *v1.Pod) (string, int) {
parent := "" parent := ""
ordinal := -1 ordinal := -1