Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2034926

Summary: Policies app fails to synchronize: ran.openshift.io/ztp-deploy-wave annotation in Resource SriovSubscription.yaml doesn't match with Policy common-sriov-sub-policy
Product: OpenShift Container Platform Reporter: Marius Cornea <mcornea>
Component: Telco EdgeAssignee: Angie Wang <angwang>
Telco Edge sub component: ZTP QA Contact: yliu1
Status: CLOSED ERRATA Docs Contact:
Severity: urgent    
Priority: unspecified CC: achernet, agurenko, keyoung
Version: 4.10   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-26 16:43:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2062918    

Description Marius Cornea 2021-12-22 13:49:44 UTC
Description of problem:

Policies app fails to synchronize: ran.openshift.io/ztp-deploy-wave annotation in Resource SriovSubscription.yaml doesn't match with Policy common-sriov-sub-policy:

rpc error: code = Unknown desc = `kustomize build /tmp/http___registry.kni-qe-0.lab.eng.rdu2.redhat.com_3000_kni-qe_ztp-site-configs/policygentemplates --enable-alpha-plugins` failed exit status 1: 2021/12/22 13:44:03 Could not build the entire policy defined by /tmp/kust-plugin-config-274844375: ran.openshift.io/ztp-deploy-wave annotation in Resource SriovSubscription.yaml doesn't match with Policy common-sriov-sub-policy Error: failure in plugin configured via /tmp/kust-plugin-config-274844375; exit status 1: exit status 1

Version-Release number of selected component (if applicable):
cnf-features-deploy 80e5ad9b2fb3577af2bbcc17283b1ffdba39a187

How reproducible:
100%

Steps to Reproduce:
1. Create policies gitops app using the repo http://registry.kni-qe-0.lab.eng.rdu2.redhat.com:3000/kni-qe/ztp-site-configs/src/kni-qe-1-4.10/policygentemplates

Actual results:
App fails to synchronize. 

Expected results:
No failures.

Additional info:

Comment 1 Ian Miller 2021-12-22 21:28:46 UTC
This error is raised when there is a mismatch on ztp waves among the CRs in a single policy. In this case the SriovCatSource is annotated with wave 1 and the other resources in common-sriov-sub-policy are in wave 2. In the short term there are a couple possible workarounds

Update the wave for the CatalogSource to align with the other CRs in that policy. In the common PolicyGenTemplate add an annotation:
    - fileName: SriovCatSource.yaml
      policyName: "sriov-sub-policy"
      annotations:
          ran.openshift.io/ztp-deploy-wave: "2"
      spec:
          ...

Split the CatalogSource into a separate policy:
    - fileName: SriovCatSource.yaml
      policyName: "sriov-catsrc-policy"
      spec:
          ...

Comment 2 Marius Cornea 2022-01-05 15:33:54 UTC
Thanks, Ian. Splitting the CatalogSources into separate policies fixed the issue for me:



```
diff --git a/policygentemplates/common-ranGen.yaml b/policygentemplates/common-ranGen.yaml
index b29bbbd..4d68e93 100644
--- a/policygentemplates/common-ranGen.yaml
+++ b/policygentemplates/common-ranGen.yaml
@@ -23,7 +23,7 @@ spec:
     - fileName: SriovSubscriptionOperGroup.yaml
       policyName: "sriov-sub-policy"
     - fileName: PtpCatSource.yaml
-      policyName: "ptp-sub-policy"
+      policyName: "ptp-catsrc-policy"
       spec:
         displayName: ptp-operator-disconnected
         image: registry.redhat.com:5000/olm/far-edge-ptp:v4.10
@@ -56,7 +56,7 @@ spec:
     - fileName: ClusterLogNS.yaml
       policyName: "log-sub-policy"
     - fileName: ClusterLogCatSource.yaml
-      policyName: "log-sub-policy"
+      policyName: "log-catsrc-policy"
       spec:
         displayName: cluster-logging-operator
         image: registry.redhat.com:5000/olm/far-edge-clo:v4.10
@@ -70,7 +70,7 @@ spec:
     - fileName: StorageNS.yaml
       policyName: "storage-sub-policy"
     - fileName: StorageCatSource.yaml
-      policyName: "storage-sub-policy"
+      policyName: "storage-catsrc-policy"
       spec:
         displayName: Openshift Local Storage Operator
         image: registry.redhat.com:5000/olm/far-edge-lso:v4.10
@@ -88,7 +88,7 @@ spec:
     - fileName: AcceleratorsOperGroup.yaml
       policyName: "accelerator-sub-policy"
     - fileName: DefaultCatsrc.yaml
-      policyName: "accelerator-sub-policy"
+      policyName: "accelerator-catsrc-policy"
       metadata:
           name: certified-operators
       spec:
```

Comment 6 yliu1 2022-03-10 19:07:33 UTC
Doc change in https://github.com/openshift-kni/cnf-features-deploy/pull/990 is verified.