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

Issues with extraCommandArgs field

XMLWordPrintable

    • 3
    • False
    • None
    • False
    • GitOps Scarlet - Sprint 3262, GitOps Scarlet - Sprint 3263, GitOps Scarlet - Sprint 3264, GitOps Scarlet - Sprint 6/3265, GitOps Scarlet - Sprint 7/3266

      Description of problem:

      1. While adding extraCommandArgs field in argocd CR, if an existing flag is added, not only will that be ignored, the other arguments which are not part of the deployment already will also be ignored

      Eg:

      ArgoCD CR:

        server:
          autoscale:
            enabled: false
          extraCommandArgs:
            - foo
            - bar
            - '--logformat'
            - text

      Server deployment:

                command:
                  - argocd-server
                  - '--staticassets'
                  - /shared/app
                  - '--dex-server'
                  - 'https://openshift-gitops-dex-server.openshift-gitops.svc.cluster.local:5556'
                  - '--repo-server'
                  - 'openshift-gitops-repo-server.openshift-gitops.svc.cluster.local:8081'
                  - '--redis'
                  - 'openshift-gitops-redis.openshift-gitops.svc.cluster.local:6379'
                  - '--loglevel'
                  - info
                  - '--logformat'
                  - text

       

      2. If you add some arguments twice by mistake, there is no filter present to prevent it from getting appended to the deployment

      Eg: 

      ArgoCD CR:

      spec:
        server:
          autoscale:
            enabled: false
          extraCommandArgs:
            - foo
            - bar
            - foo
            - bar

      Server deployment:

                command:
                  - argocd-server
                  - '--staticassets'
                  - /shared/app
                  - '--dex-server'
                  - 'https://openshift-gitops-dex-server.openshift-gitops.svc.cluster.local:5556'
                  - '--repo-server'
                  - 'openshift-gitops-repo-server.openshift-gitops.svc.cluster.local:8081'
                  - '--redis'
                  - 'openshift-gitops-redis.openshift-gitops.svc.cluster.local:6379'
                  - '--loglevel'
                  - info
                  - '--logformat'
                  - text
                  - foo
                  - bar
                  - foo
                  - bar

       

      3. Adding argument and value as a single element causes the pod to crash

      $ oc get argocd openshift-gitops -n openshift-gitops -o jsonpath='{.spec.server.extraCommandArgs}'
      ["foo bar"]
      
      
      $ oc get pods -n openshift-gitops
      NAME                                                          READY   STATUS             RESTARTS      AGE
      cluster-67fb8d65f4-4kvh7                                      1/1     Running            0             67m
      gitops-plugin-f4f8674f6-qx69t                                 1/1     Running            0             67m
      kam-d69d7c57d-qmnq2                                           1/1     Running            0             67m
      openshift-gitops-application-controller-0                     1/1     Running            0             67m
      openshift-gitops-applicationset-controller-5668c45c99-f2qn6   1/1     Running            0             67m
      openshift-gitops-dex-server-6cc9d45b67-cdpst                  1/1     Running            0             67m
      openshift-gitops-redis-78b7b54559-whflt                       1/1     Running            0             67m
      openshift-gitops-repo-server-5789bc578f-twtff                 1/1     Running            0             67m
      openshift-gitops-server-5d95dd67b9-5lrch                      0/1     CrashLoopBackOff   4 (39s ago)   2m3s
      openshift-gitops-server-f56dfbb86-rdp6h                       1/1     Running            0             67m

       

      Workaround

      None

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

      1. Install the operator
      2. Configuration as mentioned above

      Actual results:

      Mentioned above

      Expected results:

      1. Passing existing argument should not result in ignoring new arguments
      2. Duplicate arguments should not be allowed to be set
      3. Pod should not crash upon setting argument and value as a single element

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Acceptance criteria: 

      Expected results are met

       

      Definition of Done:

      Acceptance criteria is met

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

       

       *

              rh-ee-rnaaz Rizwana Naaz
              rhn-support-vab Varsha B
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: