@@ -19,6 +19,7 @@ import (
19
19
"k8s.io/apimachinery/pkg/runtime"
20
20
"k8s.io/apimachinery/pkg/util/sets"
21
21
"k8s.io/cli-runtime/pkg/resource"
22
+ "k8s.io/utils/ptr"
22
23
"sigs.k8s.io/controller-runtime/pkg/client"
23
24
"sigs.k8s.io/yaml"
24
25
@@ -277,6 +278,11 @@ func (c Converter) Convert(rv1 RegistryV1, installNamespace string, targetNamesp
277
278
annotations := util .MergeMaps (rv1 .CSV .Annotations , depSpec .Spec .Template .Annotations )
278
279
annotations ["olm.targetNamespaces" ] = strings .Join (targetNamespaces , "," )
279
280
depSpec .Spec .Template .Annotations = annotations
281
+
282
+ // Hardcode the deployment with RevisionHistoryLimit=1 to replicate OLMv0 behavior
283
+ // https://github.com/operator-framework/operator-lifecycle-manager/blob/dfd0b2bea85038d3c0d65348bc812d297f16b8d2/pkg/controller/install/deployment.go#L181
284
+ depSpec .Spec .RevisionHistoryLimit = ptr .To (int32 (1 ))
285
+
280
286
deployments = append (deployments , appsv1.Deployment {
281
287
TypeMeta : metav1.TypeMeta {
282
288
Kind : "Deployment" ,
@@ -328,8 +334,8 @@ func (c Converter) Convert(rv1 RegistryV1, installNamespace string, targetNamesp
328
334
APIGroups : []string {corev1 .GroupName },
329
335
Resources : []string {"namespaces" },
330
336
})
337
+ clusterPermissions = append (clusterPermissions , p )
331
338
}
332
- clusterPermissions = append (clusterPermissions , permissions ... )
333
339
permissions = nil
334
340
}
335
341
0 commit comments