controller: various fixes for the deployment controller
Changes: * moved waiting for synced caches before starting any work * refactored worker() to really quit on quit * changed queue to a ratelimiting queue and added retries on errors * deep-copy deployments before mutating - we still need to deep-copy replica sets and pods
This commit is contained in:
@@ -753,3 +753,15 @@ func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired
|
||||
|
||||
return int32(surge), int32(unavailable), nil
|
||||
}
|
||||
|
||||
func DeploymentDeepCopy(deployment *extensions.Deployment) (*extensions.Deployment, error) {
|
||||
objCopy, err := api.Scheme.DeepCopy(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
copied, ok := objCopy.(*extensions.Deployment)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("expected Deployment, got %#v", objCopy)
|
||||
}
|
||||
return copied, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user