-
Bug
-
Resolution: Done
-
Normal
-
4.16, 4.17, 4.18
-
None
-
Quality / Stability / Reliability
-
False
-
-
1
-
None
-
None
-
None
-
None
-
None
-
OSDOCS Sprint 269
-
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/networking-operators#nw-cno-enable-ip-forwarding_cluster-network-operator
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: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/networking-operators#nw-cno-enable-ip-forwarding_cluster-network-operator 4.17 docs: https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/networking/networking-operators#nw-cno-enable-ip-forwarding_cluster-network-operator 4.16 docs: https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/networking/networking-operators#nw-cno-enable-ip-forwarding_cluster-network-operator