Skip to content

Commit

Permalink
Merge pull request #1691 from andreaskaris/ipforwarding
Browse files Browse the repository at this point in the history
OCPBUGS-23788: Only allow valid values for gatewayConfig.ipForwarding
  • Loading branch information
openshift-merge-bot[bot] authored Feb 15, 2024
2 parents e741d64 + 7b7e068 commit 750a3e2
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,17 @@ spec:
is ignored.
type: boolean
type: object
x-kubernetes-validations:
- message: invalid value for IPForwarding, valid values are 'Restricted'
or 'Global'
rule: '!has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig)
|| !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig) ||
!has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding)
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== oldSelf.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Restricted'' || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Global'''
status:
description: NetworkStatus is detailed operator status, which is distilled
up to the Network clusteroperator object.
Expand Down
11 changes: 11 additions & 0 deletions operator/v1/0000_70_cluster-network-operator_01-Default.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,17 @@ spec:
is ignored.
type: boolean
type: object
x-kubernetes-validations:
- message: invalid value for IPForwarding, valid values are 'Restricted'
or 'Global'
rule: '!has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig)
|| !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig) ||
!has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding)
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== oldSelf.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Restricted'' || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Global'''
status:
description: NetworkStatus is detailed operator status, which is distilled
up to the Network clusteroperator object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,17 @@ spec:
is ignored.
type: boolean
type: object
x-kubernetes-validations:
- message: invalid value for IPForwarding, valid values are 'Restricted'
or 'Global'
rule: '!has(self.defaultNetwork) || !has(self.defaultNetwork.ovnKubernetesConfig)
|| !has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig) ||
!has(self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding)
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== oldSelf.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
|| self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Restricted'' || self.defaultNetwork.ovnKubernetesConfig.gatewayConfig.ipForwarding
== ''Global'''
status:
description: NetworkStatus is detailed operator status, which is distilled
up to the Network clusteroperator object.
Expand Down
Loading

0 comments on commit 750a3e2

Please sign in to comment.