Skip to content

Commit ab27044

Browse files
author
Jeff Peeler
committed
fix(olm): remove duplicated code
This is already handled in a more clear way in removeDanglingChildCSVs.
1 parent 337b156 commit ab27044

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

pkg/controller/operators/olm/operator.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -438,25 +438,6 @@ func (a *Operator) syncClusterServiceVersion(obj interface{}) (syncError error)
438438

439439
outCSV, syncError := a.transitionCSVState(*clusterServiceVersion)
440440

441-
opNamespace, ok := clusterServiceVersion.Annotations["olm.operatorNamespace"]
442-
if ok {
443-
// ensure "parent" CSV has not been deleted
444-
csvs := a.csvsInNamespace(opNamespace)
445-
csv, found := csvs[clusterServiceVersion.Name]
446-
if !found {
447-
targetNamespaces, ok := clusterServiceVersion.Annotations["olm.targetNamespaces"]
448-
if !ok {
449-
return fmt.Errorf("Did not find targetNamespaces annotation on %v", csv)
450-
}
451-
for _, ns := range strings.Split(targetNamespaces, ",") {
452-
if err := a.client.OperatorsV1alpha1().ClusterServiceVersions(ns).Delete(csv.Name, &metav1.DeleteOptions{}); err != nil {
453-
return err
454-
}
455-
}
456-
return nil
457-
}
458-
}
459-
460441
// no changes in status, don't update
461442
if outCSV.Status.Phase == clusterServiceVersion.Status.Phase && outCSV.Status.Reason == clusterServiceVersion.Status.Reason && outCSV.Status.Message == clusterServiceVersion.Status.Message {
462443
return

0 commit comments

Comments
 (0)