Browse code

Merge pull request #9539 from kargakis/fix-image-change-deployments

Merged by openshift-bot

OpenShift Bot authored on 2016/06/25 18:25:03
Showing 1 changed files
... ...
@@ -136,9 +136,12 @@ func canTrigger(config, decoded *deployapi.DeploymentConfig) (bool, []deployapi.
136 136
 
137 137
 		// We need stronger checks in order to validate that this template
138 138
 		// change is an image change. Look at the deserialized config's
139
-		// triggers and compare with the present trigger.
140
-		if !triggeredByDifferentImage(*t.ImageChangeParams, *decoded) {
141
-			continue
139
+		// triggers and compare with the present trigger. Initial deployments
140
+		// should always trigger since there is no previous config to compare to.
141
+		if config.Status.LatestVersion > 0 {
142
+			if !triggeredByDifferentImage(*t.ImageChangeParams, *decoded) {
143
+				continue
144
+			}
142 145
 		}
143 146
 
144 147
 		canTriggerByImageChange = true