Skip to content

Commit

Permalink
fix(annotation): don't annotate deployments that aren't owned by a CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Mar 28, 2019
1 parent 3a4c2b2 commit af46eef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/controller/operators/olm/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,9 @@ func (a *Operator) ensureDeploymentAnnotations(logger *logrus.Entry, csv *v1alph
return nil
}

var depNames []string
depNames := make(map[string]struct{})
for _, dep := range strategyDetailsDeployment.DeploymentSpecs {
depNames = append(depNames, dep.Name)
depNames[dep.Name] = struct{}{}
}
existingDeployments, err := a.lister.AppsV1().DeploymentLister().Deployments(csv.GetNamespace()).List(labels.Everything())
if err != nil {
Expand All @@ -1435,7 +1435,9 @@ func (a *Operator) ensureDeploymentAnnotations(logger *logrus.Entry, csv *v1alph
// compare deployments to see if any need to be created/updated
existingMap := map[string]*appsv1.Deployment{}
for _, d := range existingDeployments {
existingMap[d.GetName()] = d
if _, ok := depNames[d.GetName()]; ok {
existingMap[d.GetName()] = d
}
}
updateErrs := []error{}
for _, dep := range existingMap {
Expand Down

0 comments on commit af46eef

Please sign in to comment.