Skip to content

Commit

Permalink
Fix DC image reactor to reconcile on DC dc.Spec.Template.Spec.Contain…
Browse files Browse the repository at this point in the history
…ers changes
  • Loading branch information
tnozicka committed Feb 8, 2018
1 parent 8913128 commit feacccc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/image/trigger/deploymentconfigs/deploymentconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,19 @@ func (i deploymentConfigTriggerIndexer) Index(obj, old interface{}) (string, *tr
default:
// updated
dc = obj.(*appsapi.DeploymentConfig)
oldDC := old.(*appsapi.DeploymentConfig)
triggers = calculateDeploymentConfigTriggers(dc)
oldTriggers := calculateDeploymentConfigTriggers(old.(*appsapi.DeploymentConfig))
oldTriggers := calculateDeploymentConfigTriggers(oldDC)
switch {
case len(oldTriggers) == 0:
change = cache.Added
case !reflect.DeepEqual(oldTriggers, triggers):
change = cache.Updated
// We need to react on image changes as well. Image names could change,
// images could be set to different value or resetted to "" e.g. by oc apply
// and we need to make sure those changes get reconciled by re-resolving images
case !reflect.DeepEqual(dc.Spec.Template.Spec.Containers, oldDC.Spec.Template.Spec.Containers):
change = cache.Updated
}
}

Expand Down Expand Up @@ -190,9 +196,6 @@ func UpdateDeploymentConfigImages(dc *appsapi.DeploymentConfig, tagRetriever tri
glog.V(4).Infof("trigger %#v in deployment %s is not resolveable", p, dc.Name)
return nil, false, nil
}
if ref == p.LastTriggeredImage {
continue
}

if len(ref) == 0 {
ref = p.LastTriggeredImage
Expand Down

0 comments on commit feacccc

Please sign in to comment.