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

oc patch command for global ip forwarding is incorrect on metalLb docs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • 4.19
    • 4.14.z, 4.15.z, 4.17.z, 4.16.z, 4.18.z
    • Documentation
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 3
    • Moderate
    • None
    • None
    • None
    • None
    • OSDOCS Sprint 268
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      The patch command:
      ```
      oc patch network.operator cluster -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}
      ```
      From the docs: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/load-balancing-with-metallb#nw-enabling-ip-forwarding-globally_about-advertising-ip-address-pool does not work.
      
      The correct command is:
      ``` 
      oc patch network.operator cluster  -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}' --type=merge 
      ```
      Note: The --type and missing quotation at the end
      
      Without the --type you will receive:
      ```
      oc patch network.operator cluster  -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}' 
      error: application/strategic-merge-patch+json is not supported by operator.openshift.io/v1, Kind=Network: the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml
      ```

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

          

      How reproducible:

          

      Steps to Reproduce:

          1.
          2.
          3.
          

      Actual results:

          Cannot execute proposed command:
      ```
      oc patch network.operator cluster -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}quote> 
      ```
      
      

      Expected results:

          Patch command should succeed.
      Using the following patch command does succeed:
      ```
      oc patch network.operator cluster --type='merge' -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}'
      ```
      
      ```
      $ oc get network.operator/cluster -ojson | jq '.spec.defaultNetwork.ovnKubernetesConfig.gatewayConfig'
      {
        "ipv4": {},
        "ipv6": {},
        "routingViaHost": false
      }
      
      $ oc patch network.operator cluster  -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"ipForwarding": "Global"}}}}}' --type=merge
      network.operator.openshift.io/cluster patched
      
      $ oc get network.operator/cluster -ojson | jq '.spec.defaultNetwork.ovnKubernetesConfig.gatewayConfig'
      {
        "ipForwarding": "Global",
        "ipv4": {},
        "ipv6": {},
        "routingViaHost": false
      }
      ```
      
      

      Additional info:

      4.18 docs link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/load-balancing-with-metallb#nw-enabling-ip-forwarding-globally_about-advertising-ip-address-pool
      
      4.17 docs link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/networking/load-balancing-with-metallb#nw-enabling-ip-forwarding-globally_about-advertising-ip-address-pool    

              rh-ee-kniederw Kevin Niederwanger
              rh-ee-kniederw Kevin Niederwanger
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: