Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-39421

[IBU][Doc] Policy name should be corrected in the example

XMLWordPrintable

    • None
    • 0.5
    • T&PS 2024 #9
    • 1
    • False
    • Hide

      None

      Show
      None
    • 2024-09-09: Created PR and pinged QE for review.

      Looking at the doc in following URL :https://docs.openshift.com/container-platform/4.16/edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.html#zztp-image-based-upgrade-prep-oadp_ztp-gitops

      There's this step:

      3. Create the oadp-cm ConfigMap object through the oadp-cm-policy in a new PolicyGenTemplate called ibu-upgrade-ranGen.yaml:

      apiVersion: ran.openshift.io/v1
      kind: PolicyGenTemplate
      metadata:
        name: example-group-ibu
        namespace: "ztp-group"
      spec:
        bindingRules:
          group-du-sno: ""
        mcp: "master"
        evaluationInterval:
          compliant: 10s
          noncompliant: 10s
        sourceFiles:
        - fileName: ConfigMapGeneric.yaml
          complianceType: mustonlyhave
          policyName: "oadp-cm-policy"
          metadata:
            name: oadp-cm
            namespace: openshift-adp
      

      Note the name is example-group-ibu

      Then it's followed by this step:
      Create a kustomization.yaml with the following content:

      apiVersion: kustomize.config.k8s.io/v1beta1
      kind: Kustomization
      
      generators: 
      - ibu-upgrade-ranGen.yaml
      
      configMapGenerator: 
      - files:
        - source-crs/ibu/PlatformBackupRestore.yaml
        #- source-crs/custom-crs/ApplicationClusterScopedBackupRestore.yaml
        #- source-crs/custom-crs/ApplicationApplicationBackupRestoreLso.yaml
        name: oadp-cm
        namespace: ztp-group
      generatorOptions:
        disableNameSuffixHash: true
      
      
      patches: 
      - target:
          group: policy.open-cluster-management.io
          version: v1
          kind: Policy
          name: group-ibu-oadp-cm-policy
        patch: |-
          - op: replace
            path: /spec/policy-templates/0/objectDefinition/spec/object-templates/0/objectDefinition/data
            value: '{{hub copyConfigMapData "ztp-group" "oadp-cm" hub}}'
      

      Note the name under patches-> target. It's "group-ibu-oadp-cm-policy".

      Using different name results in an issue.
      We should adjust the example names, so above the name should be:
      instead of
      name: group-ibu-oadp-cm-policy
      adjusted to:
      name: example-group-ibu-oadp-cm-policy

              rhn-support-amolnar Alexandra Molnar
              achuzhoy@redhat.com Alexander Chuzhoy
              Nikita Kononov Nikita Kononov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: