Revision handling in federated deployment controller

This commit is contained in:
Marcin Wielgus
2016-11-22 16:12:32 +01:00
committed by Marcin
parent 1f82f2491a
commit 11b9706a19
5 changed files with 158 additions and 13 deletions

View File

@@ -562,10 +562,7 @@ func (fdc *DeploymentController) reconcileDeployment(key string) (reconciliation
}
// The object can be modified.
ld := &extensionsv1.Deployment{
ObjectMeta: fedutil.DeepCopyRelevantObjectMeta(fd.ObjectMeta),
Spec: fedutil.DeepCopyApiTypeOrPanic(fd.Spec).(extensionsv1.DeploymentSpec),
}
ld := fedutil.DeepCopyDeployment(fd)
specReplicas := int32(replicas)
ld.Spec.Replicas = &specReplicas
@@ -585,7 +582,7 @@ func (fdc *DeploymentController) reconcileDeployment(key string) (reconciliation
currentLd := ldObj.(*extensionsv1.Deployment)
// Update existing replica set, if needed.
if !fedutil.ObjectMetaAndSpecEquivalent(ld, currentLd) {
if !fedutil.DeploymentEquivalent(ld, currentLd) {
fdc.eventRecorder.Eventf(fd, api.EventTypeNormal, "UpdateInCluster",
"Updating deployment in cluster %s", clusterName)