@@ -56,22 +56,19 @@ func (e transientError) Error() string {
56
56
57
57
// Handle processes config and creates a new deployment if necessary.
58
58
func (c * DeploymentConfigController ) Handle (config * deployapi.DeploymentConfig ) error {
59
- // Inspect a deployment configuration every time the controller reconciles it
60
- details , existingDeployments , latestDeploymentExists , err := c .findDetails (config )
61
- if err != nil {
62
- return err
63
- }
64
- config , err = c .updateDetails (config , details )
65
- if err != nil {
66
- return transientError (err .Error ())
67
- }
59
+ // TODO(danmace): Don't use findDetails yet. See: https://github.com/openshift/origin/pull/5530
68
60
69
61
// Only deploy when the version has advanced past 0.
70
62
if config .LatestVersion == 0 {
71
63
glog .V (5 ).Infof ("Waiting for first version of %s" , deployutil .LabelForDeploymentConfig (config ))
72
64
return nil
73
65
}
74
66
67
+ existingDeployments , err := c .deploymentClient .listDeploymentsForConfig (config .Namespace , config .Name )
68
+ if err != nil {
69
+ return err
70
+ }
71
+
75
72
var inflightDeployment * kapi.ReplicationController
76
73
for _ , deployment := range existingDeployments .Items {
77
74
@@ -104,6 +101,7 @@ func (c *DeploymentConfigController) Handle(config *deployapi.DeploymentConfig)
104
101
}
105
102
106
103
// if the latest deployment exists then nothing else needs to be done
104
+ latestDeploymentExists , _ := deployutil .LatestDeploymentInfo (config , existingDeployments )
107
105
if latestDeploymentExists {
108
106
return nil
109
107
}
@@ -184,6 +182,7 @@ func (i *deploymentClientImpl) updateDeployment(namespace string, deployment *ka
184
182
185
183
// findDetails inspects the given deployment configuration for any failure causes
186
184
// and returns any found details about it
185
+ // TODO(danmace): Don't use findDetails yet. See: https://github.com/openshift/origin/pull/5530
187
186
func (c * DeploymentConfigController ) findDetails (config * deployapi.DeploymentConfig ) (string , * kapi.ReplicationControllerList , bool , error ) {
188
187
// Check if any existing inflight deployments (any non-terminal state).
189
188
existingDeployments , err := c .deploymentClient .listDeploymentsForConfig (config .Namespace , config .Name )
0 commit comments