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

kustomize-generator.bash does not generate ordered output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • 4.20
    • GitOps ZTP
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Important
    • None
    • None
    • Proposed
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      The
      https://github.com/openshift-kni/cnf-features-deploy/blob/master/ztp/tools/siteconfig-converter/hack/kustomize-generator.bash
      tool does not generate sorted output.
      
      For directory structure:
      
      sno-extra-manifest
      ├── 01-container-mount-ns-and-kubelet-conf-master.yaml
      ├── 01-container-mount-ns-and-kubelet-conf-worker.yaml
      ├── 01-disk-encryption-pcr-rebind-master.yaml
      ├── 01-disk-encryption-pcr-rebind-worker.yaml
      ├── 03-sctp-machine-config-master.yaml
      ├── 03-sctp-machine-config-worker.yaml
      ├── 04-rh-internal-icsp.yaml
      ├── 06-kdump-master.yaml
      ├── 06-kdump-worker.yaml
      ├── 07-sriov-related-kernel-args-master.yaml
      ├── 07-sriov-related-kernel-args-worker.yaml
      ├── 08-set-rcu-normal-master.yaml
      ├── 08-set-rcu-normal-worker.yaml
      ├── 09-openshift-marketplace-ns.yaml
      ├── 99-crio-disable-wipe-master.yaml
      ├── 99-crio-disable-wipe-worker.yaml
      ├── 99-sync-time-once-master.yaml
      ├── 99-sync-time-once-worker.yaml
      ├── disk-encryption.yaml.tmpl
      ├── enable-crun-master.yaml
      ├── enable-crun-worker.yaml
      └── image-registry-partition-mc.yaml.tmpl
      
      Running the tool generates this (or a variation). The order seems to be based
      on the order the files (inodes) were added to the directory, rather than
      lexigraphically sorted
      
      configMapGenerator:
      - files:
        - sno-extra-manifest/enable-crun-master.yaml
        - sno-extra-manifest/08-set-rcu-normal-master.yaml
        - sno-extra-manifest/07-sriov-related-kernel-args-worker.yaml
        - sno-extra-manifest/99-crio-disable-wipe-worker.yaml
        - sno-extra-manifest/04-rh-internal-icsp.yaml
        - sno-extra-manifest/99-sync-time-once-master.yaml
        - sno-extra-manifest/06-kdump-worker.yaml
        - sno-extra-manifest/03-sctp-machine-config-worker.yaml
        - sno-extra-manifest/01-disk-encryption-pcr-rebind-master.yaml
        - sno-extra-manifest/01-container-mount-ns-and-kubelet-conf-master.yaml
        - sno-extra-manifest/99-crio-disable-wipe-master.yaml
        - sno-extra-manifest/99-sync-time-once-worker.yaml
        - sno-extra-manifest/07-sriov-related-kernel-args-master.yaml
        - sno-extra-manifest/enable-crun-worker.yaml
        - sno-extra-manifest/08-set-rcu-normal-worker.yaml
        - sno-extra-manifest/09-openshift-marketplace-ns.yaml
        - sno-extra-manifest/01-disk-encryption-pcr-rebind-worker.yaml
        - sno-extra-manifest/01-container-mount-ns-and-kubelet-conf-worker.yaml
        - sno-extra-manifest/06-kdump-master.yaml
        - sno-extra-manifest/03-sctp-machine-config-master.yaml
        name: extra-manifests-cm
        namespace: helix80
      generatorOptions:
        disableNameSuffixHash: true
      
      
          

      Version-Release number of selected component (if applicable):

      https://github.com/openshift-kni/cnf-features-deploy/blob/master/ztp/tools/siteconfig-converter/hack/kustomize-generator.bash in all releases that have this tool
          

      How reproducible:

      Always
          

      Steps to Reproduce:

          1. Run the kustomize-generator.bash on an extra-manifests directory
          2. Compare results order to 'ls' order
          

      Actual results:

      Output is arbitrarily ordered
      
      

      Expected results:

      Output is sorted for deterministic results given the intended use of ##-foo.yaml
      file naming convention to set the order.
          

      Additional info:

      
          

              saskari@redhat.com Saeid Askari
              rhn-support-dgonyier Dwaine Gonyier
              None
              None
              Dwaine Gonyier Dwaine Gonyier
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: