()
| 424 | } |
| 425 | |
| 426 | func (c *Controller) updateAssignmentHash() (update bool, newHash string) { |
| 427 | // get the hash of the assignment |
| 428 | oldHash := c.assignmentHashCode |
| 429 | newHash, err := c.aresControllerClient.GetAssignmentHash(c.jobNS, c.serviceConfig.Environment.InstanceID) |
| 430 | if err != nil { |
| 431 | c.serviceConfig.Logger.Error("Failed to get assignment hash from aresDB controller", |
| 432 | zap.String("jobNamespace", c.jobNS), |
| 433 | zap.String("aresDB Controller", c.serviceConfig.ControllerConfig.Address), |
| 434 | zap.Error(err)) |
| 435 | return false, "" |
| 436 | } |
| 437 | |
| 438 | if strings.Compare(oldHash, newHash) == 0 { |
| 439 | return false, newHash |
| 440 | } |
| 441 | c.serviceConfig.Logger.Info("Found assignment hash changed", |
| 442 | zap.String("jobNamespace", c.jobNS), |
| 443 | zap.String("aresDB Controller", c.serviceConfig.ControllerConfig.Address)) |
| 444 | |
| 445 | return true, newHash |
| 446 | } |
| 447 | |
| 448 | func (c *Controller) addDriver( |
| 449 | jobConfig *rules.JobConfig, aresCluster string, aresClusterDrivers map[string]*Driver, stop bool) bool { |
no test coverage detected