Skip to content

Commit de72c1c

Browse files
anik120openshift-merge-bot[bot]
authored andcommitted
UPSTREAM: 1981: Backporting NetworkPolicy support for OLM bundles
This is a hack to backport "NetworkPolicy object kind in bundles" support from operator-framework/operator-registry#1675 The feature was introduced in OCP 4.20 with a operator-registry bump to v1.55.0. Ref: 1. operator-registry v1.55.0 release: https://github.com/operator-framework/operator-registry/releases/tag/v1.55.0 2. operator-registry bump in OCP 4.20: operator-framework/operator-controller#1981 Because the upstream PR is not being backported in operator-registry to older tags (with new z stream releases), this achieves a downstream-only backport for this feature.
1 parent ea60189 commit de72c1c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/rukpak/convert/registryv1.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ func Convert(in RegistryV1, installNamespace string, targetNamespaces []string)
366366
for _, obj := range in.Others {
367367
obj := obj
368368
supported, namespaced := registrybundle.IsSupported(obj.GetKind())
369+
// NOTE: This is a hack to backport "NetworkPolicy object kind in bundles" support from
370+
// https://github.com/operator-framework/operator-registry/pull/1675
371+
// The feature was introduced in OCP 4.20 with a operator-registry bump to v1.55.0.
372+
// Ref:
373+
// 1. operator-registry v1.55.0 release: https://github.com/operator-framework/operator-registry/releases/tag/v1.55.0
374+
// 2. operator-registry bump in OCP 4.20: https://github.com/operator-framework/operator-controller/pull/1981
375+
// Because the upstream PR is not being backported in operator-registry to older tags (with new z stream releases),
376+
// this achieves a downstream-only backport for this feature.
377+
if obj.GetKind() == "NetworkPolicy" {
378+
supported, namespaced = true, true
379+
}
369380
if !supported {
370381
return nil, fmt.Errorf("bundle contains unsupported resource: Name: %v, Kind: %v", obj.GetName(), obj.GetKind())
371382
}

0 commit comments

Comments
 (0)