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

Support configuring imagePullPolicy for GitOps components at Operator and ArgoCD CR levels

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • GitOps Crimson Sprint 22, GitOps Crimson Sprint 23

      Story (Required)

      As an administrator, I want to configure the imagePullPolicy for GitOps/Argo CD components at two levels:

      1. Operator (Subscription) level – define a global default policy that applies to all Argo CD instances managed by the GitOps Operator.
      1. ArgoCD CR level – allow overriding the global default per Argo CD instance or per component.

      This ensures that I can set a cluster-wide policy while still having the flexibility to fine-tune policies for specific Argo CD deployments.

      Background and Approach (Required)

      Today, GitOps components default to imagePullPolicy: Always. This leads to unnecessary image pulls during pod restarts and node maintenance, causing extra network usage and slower pod startup times. By enabling configuration:

      • Administrators can reduce network load in production by using cached images (IfNotPresent).
      • Developers can still use Always in test environments to ensure latest image updates.
      • The operator provides flexibility and control, improving both performance and operational efficiency.

      Approach

      • Extend GitOps Operator Subscription to include an IMAGE_PULL_POLICY parameter  via environment variable. This value will be passed into the operator’s controller logic.
      • Update the ArgoCD CRD schema to introduce a spec.imagePullPolicy field at both global.
      • Enhance reconciliation logic:
        • On reconciling an ArgoCD CR, check if spec.imagePullPolicy is set.
        • If not set, use the Subscription-level default.
        • If neither is set, default to Always.
      • Add unit and e2e tests to validate:
        • Subscription-only config.
        • CR-only config.
        • CR overriding Subscription.
        • Backward compatibility with existing clusters.
      • Provide operator documentation with configuration examples.

      Out of Scope

      • <Defines what is not included in this story.>

      Dependencies

      • <Describes what this story depends on. Dependent stories and EPICs should be linked to the story.>

      Acceptance Criteria (Mandatory)

      • Operator reads a global imagePullPolicy value from Subscription config  via environment variable.
      • ArgoCD CR includes a field for imagePullPolicy.
      • If both Subscription and ArgoCD CR specify values:
        • CR value takes precedence (per-instance override).
        • If CR does not specify, fall back to Subscription default.
      • If neither specify, default remains Always (backward compatibility).
      • Documentation updated with examples:
        • How to configure at Subscription level.
        • How to override in ArgoCD CR.

      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.

              rhn-support-alkumari Alka Kumari
              rh-ee-sghadi Siddhesh Ghadi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: