Skip to content

Commit 406020c

Browse files
committed
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 8f42f09 commit 406020c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/operator-controller/rukpak/convert/registryv1.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,17 @@ func (c Converter) Convert(rv1 RegistryV1, installNamespace string, targetNamesp
402402
for _, obj := range rv1.Others {
403403
obj := obj
404404
supported, namespaced := registrybundle.IsSupported(obj.GetKind())
405+
// NOTE: This is a hack to backport "NetworkPolicy object kind in bundles" support from
406+
// https://github.com/operator-framework/operator-registry/pull/1675
407+
// The feature was introduced in OCP 4.20 with a operator-registry bump to v1.55.0.
408+
// Ref:
409+
// 1. operator-registry v1.55.0 release: https://github.com/operator-framework/operator-registry/releases/tag/v1.55.0
410+
// 2. operator-registry bump in OCP 4.20: https://github.com/operator-framework/operator-controller/pull/1981
411+
// Because the upstream PR is not being backported in operator-registry to older tags (with new z stream releases),
412+
// this achieves a downstream-only backport for this feature.
413+
if obj.GetKind() == "NetworkPolicy" {
414+
supported, namespaced = true, true
415+
}
405416
if !supported {
406417
return nil, fmt.Errorf("bundle contains unsupported resource: Name: %v, Kind: %v", obj.GetName(), obj.GetKind())
407418
}

0 commit comments

Comments
 (0)