Created
May 5, 2019 10:34
-
-
Save openstacker/e3504f43a98f4be87af8a45864020534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for _, t := range pc { | |
for _, c := range n.Status.Conditions { | |
log.Info("Supplied Condition", zap.String("t", string(t.Type)), zap.String("c", string(t.Status)), zap.String("c", string(t.MinimumWaitingTime))) | |
log.Info("Node Condition", zap.String("c", string(c.Type)), zap.String("s", string(c.Status)), zap.String("t", c.LastTransitionTime.String())) | |
log.Info("Node", zap.String("node", n.Name)) | |
current := time.Now() | |
lttDuration := c.LastTransitionTime.Add(time.Duration(t.MinimumWaitingTime) * time.Minute) | |
log.Info("time", zap.String("current", current.String()), zap.String("ltt", lttDuration.String())) | |
if c.Type == t.Type && c.Status == t.Status && lttDuration.Before(current) { | |
log.Info("****selected node****", zap.String("node", n.Name)) | |
return true | |
} | |
} | |
} | |
return false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment