+++ This bug was initially created as a clone of Bug #2028240 +++ Description of problem: The reference ZTP configuration uses a separate CatalogSource for each operator subscription. These operators will all be in the same disconnected registry in the target use case, and are all contained in the redhat-operators registry in connected environments. Using a single CatalogSource for all operators reduces CPU use by olm indexing and liveness/readiness probes. Version-Release number of selected component (if applicable): 4.10 How reproducible: Always Steps to Reproduce: 1. oc get CatalogSource -A on ZTP installed system Actual results: 5 CatalogSources are reported Expected results: 1 CatalogSource Additional info:
Verification with v4.9.0-18 ztp-site-generator container image. Looks like example is updated, but referenced source-crs are not added to release-4.9 branch: https://github.com/openshift-kni/cnf-features-deploy/blob/release-4.9/ztp/gitops-subscriptions/argocd/resource-hook-example/policygentemplates/common-ranGen.yaml#L62 Does not have it in source-crs: https://github.com/openshift-kni/cnf-features-deploy/commits/release-4.9/ztp/source-crs # Error syncing policies app: ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG] [watcher:135]: Objects to delete are: ['group-du-sno', 'worker-2', 'common'] ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG] [watcher:136]: Objects to create/update are: [] ztp-hooks.watcher 2022-01-21 18:03:52 UTC [DEBUG] [watcher:150]: No objects to update ztp-hooks.watcher 2022-01-21 18:03:52 UTC [ERROR] [watcher:85]: PolicyGenWrapper failed: Manifest conversion failed: 2022/01/21 18:03:52 Could not build the entire policy defined by tmpey1hlgod: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory panic: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory goroutine 1 [running]: main.InitiatePolicyGen(0x7ffc5eb0e6fc, 0x17, 0x7ffc5eb0e714, 0x13, 0x7ffc5eb0e728, 0x17, 0xc000100000) /go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:110 +0x1a11 main.main() /go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:28 +0x154 Traceback (most recent call last): File "/usr/src/hook/ztp/resource-generator/src/watcher.py", line 83, in __init__ raise Exception(f"Manifest conversion failed: {output[1].decode()}") Exception: Manifest conversion failed: 2022/01/21 18:03:52 Could not build the entire policy defined by tmpey1hlgod: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory panic: open /tmp/ztp/source-crs/DefaultCatsrc.yaml: no such file or directory goroutine 1 [running]: main.InitiatePolicyGen(0x7ffc5eb0e6fc, 0x17, 0x7ffc5eb0e714, 0x13, 0x7ffc5eb0e728, 0x17, 0xc000100000) /go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:110 +0x1a11 main.main() /go/src/cnf-features-deploy/app/ztp/ztp-policy-generator/kustomize/plugin/policyGenerator/v1/policygenerator/policyGenerator.go:28 +0x154
Verified with latest 4.9 ztp site generate image using single catalog source.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.9.22 security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:0561