-
Bug
-
Resolution: Done
-
Normal
-
4.14.z, 4.15.z, 4.17.z, 4.16.z, 4.18.z
-
None
-
Quality / Stability / Reliability
-
False
-
-
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