Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-7994

RespectIgnoreDifferences does not honour IgnoreDiff applied for lists

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Description of Problem

      If IgnoreDiff is applied for some values of a list using jqPathExpression, the RespectIgnoreDifferences sync option does not take into account the filter expression and  ignores the entire field instead while syncing. Hence the desired values for that field cannot be synced via ArgoCD.

       

      Additional Info

      Problem Reproduction

      • <How do we reproduce the problem?>

      Reproducibility

      • Always

      Prerequisites/Environment

      • <OpenShift, managed service (e.g., ROSA, ARO), operators, layered product, and other software versions, build details>

      Steps to Reproduce

      • Create and manage Service Account such as `default` via ArgoCD
      • Since OCP creates default ImagepullSecrets like `default-dockerfg-xxx` for the Service Account with for authentication to Internal Image Registry, we add below IgnoreDiff to the Application spec:
       ignoreDifferences:
         - jqPathExpressions:
             - '.imagePullSecrets[] | select(.name | test("-dockercfg-"))'
            kind: ServiceAccount 
      • The desired manifest for the Service Account is as:
      apiVersion: v1
      imagePullSecrets:
      - name: my-database-secret
      - name: test-secret
      kind: ServiceAccount
      metadata:
        name: default
        namespace: test-sa-gitops 
      • Syncing the Application with RespectIgnoreDifferences flag, fails as the new imagePullSecrets added via Git are not applied to the cluster and the application stays OutOfSync. The RespectIgnoreDifferences, ignores the entire field while syncing.

      Expected Results

      • The `RespectIgnoreDifferences` should sync the other values of the field, which do not match the filtered jq expression.

      Actual Results

      • The RespectIgnoreDifferences, ignores the entire field while syncing.

      Problem Analysis

      • <Completed by engineering team as part of the triage/refinement process>

      Root Cause

      • <What is the root cause of the problem? Or, why is it not a bug?>

      Workaround (If Possible)

      • <Are there any workarounds we can provide to the customers?>

      Fix Approaches

      • <If we decide to fix this bug, how will we do it?>

      Acceptance Criteria

      • ...

      Definition of Done

      • Code Complete:
        • All code has been written, reviewed, and approved.
      • Tested:
        • Unit tests have been written and passed.
        • Ensure code coverage is not reduced with the changes.
        • Integration tests have been automated.
        • System tests have been conducted, and all critical bugs have been fixed.
        • Tested and merged on OpenShift either upstream or downstream on a local build.
      • Documentation:
        • User documentation or release notes have been written (if applicable).
      • Build:
        • Code has been successfully built and integrated into the main repository / project.
        • Midstream changes (if applicable) are done, reviewed, approved and merged.
      • Review:
        • Code has been peer-reviewed and meets coding standards.
        • All acceptance criteria defined in the user story have been met.
        • Tested by reviewer on OpenShift.
      • Deployment:
        • The feature has been deployed on OpenShift cluster for testing.

              rh-ee-anjoseph Anand Francis Joseph
              rhn-support-jyarora Jyotsana Arora
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: