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

Documentation_issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 4.16
    • Documentation
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html-single/cli_tools/index#oc-patch

      oc patch command behaves weirdly differently (using ArgoCD CR , but wondering if this applies to CRs such deployment/pods ...):

      --add env entry if not entries are there (env: does not exist)
      oc patch ArgoCD openshift-gitops -n openshift-gitops --type=json --patch '[{"op": "add", "path": "/spec/controller/env", "value": [

      {"name":"ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH","value":"false"}

      ]}]' #this one works because each element has a space after it "value": ; "op": ; etc.
      oc patch ArgoCD openshift-gitops -n openshift-gitops --type=json --patch '[{"op":"add","path":"/spec/controller/env","value":{"name":"ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH","value":"false"}}]' # weirdly does not work because of there is no spaces there

      add a second entry in env:
      oc patch ArgoCD openshift-gitops -n openshift-gitops --type=json --patch '[{"op":"add","path":"/spec/controller/env/-","value":{"name":"ARGOCD_APPLICATION_CONTROLLER_REPO_SERVER_PLAINTEXT","value":"false"}}]'

      ---- to add : 1 did not work (because of the space after elements such "op": , 2 worked
      oc patch ArgoCD openshift-gitops n openshift-gitops --type=json --patch '[{"op": "add", "path": "/spec/controller/env/", "value": [

      {"name":"ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH","value":"false"}

      ]}]' : does not work
      oc patch ArgoCD openshift-gitops -n openshift-gitops --type=json --patch '[{"op":"add","path":"/spec/controller/env/-","value":{"name":"ARGOCD_APPLICATION_CONTROLLER_PERSIST_RESOURCE_HEALTH","value":"false"}}]' : worked

      Thank you

              ocp-docs-bot OCP DocsBot
              lhalleb@redhat.com Lazhar Halleb
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: