mirror of
https://github.com/stakater/Reloader.git
synced 2026-03-02 17:30:19 +00:00
Add tests for leadership election
Pull liveness into leadership to ease testing, logically the liveness probe is directly affected by leadership so it makes sense here. Moved some of the components of the controller tests into the testutil package for reuse in my own tests.
This commit is contained in:
@@ -19,6 +19,7 @@ func (r ResourceCreatedHandler) Handle() error {
|
||||
logrus.Errorf("Resource creation handler received nil resource")
|
||||
} else {
|
||||
config, _ := r.GetConfig()
|
||||
// process resource based on its type
|
||||
return doRollingUpgrade(config, r.Collectors)
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -21,6 +21,7 @@ func (r ResourceUpdatedHandler) Handle() error {
|
||||
} else {
|
||||
config, oldSHAData := r.GetConfig()
|
||||
if config.SHAValue != oldSHAData {
|
||||
// process resource based on its type
|
||||
return doRollingUpgrade(config, r.Collectors)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user