Skip to content

Commit

Permalink
Merge pull request #412 from danwinship/network-config-validation
Browse files Browse the repository at this point in the history
add kubebuilder annotations for network types
  • Loading branch information
openshift-merge-robot authored Sep 25, 2019
2 parents 26a429a + 14ed9ec commit f6c477b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type ClusterNetworkEntry struct {
CIDR string `json:"cidr"`

// The size (prefix) of block to allocate to each node.
// +kubebuilder:validation:Minimum=0
HostPrefix uint32 `json:"hostPrefix"`
}

Expand Down
8 changes: 8 additions & 0 deletions operator/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type NetworkSpec struct {
// Not all network providers support multiple ClusterNetworks
type ClusterNetworkEntry struct {
CIDR string `json:"cidr"`
// +kubebuilder:validation:Minimum=0
HostPrefix uint32 `json:"hostPrefix"`
}

Expand Down Expand Up @@ -117,6 +118,7 @@ type SimpleMacvlanConfig struct {

// mtu is the mtu to use for the macvlan interface. if unset, host's
// kernel will select the value.
// +kubebuilder:validation:Minimum=0
// +optional
MTU uint32 `json:"mtu,omitempty"`
}
Expand Down Expand Up @@ -209,11 +211,13 @@ type OpenShiftSDNConfig struct {
Mode SDNMode `json:"mode"`

// vxlanPort is the port to use for all vxlan packets. The default is 4789.
// +kubebuilder:validation:Minimum=0
// +optional
VXLANPort *uint32 `json:"vxlanPort,omitempty"`

// mtu is the mtu to use for the tunnel interface. Defaults to 1450 if unset.
// This must be 50 bytes smaller than the machine's uplink.
// +kubebuilder:validation:Minimum=0
// +optional
MTU *uint32 `json:"mtu,omitempty"`

Expand All @@ -230,10 +234,12 @@ type OpenShiftSDNConfig struct {
// KuryrConfig configures the Kuryr-Kubernetes SDN
type KuryrConfig struct {
// The port kuryr-daemon will listen for readiness and liveness requests.
// +kubebuilder:validation:Minimum=0
// +optional
DaemonProbesPort *uint32 `json:"daemonProbesPort,omitempty"`

// The port kuryr-controller will listen for readiness and liveness requests.
// +kubebuilder:validation:Minimum=0
// +optional
ControllerProbesPort *uint32 `json:"controllerProbesPort,omitempty"`

Expand All @@ -258,6 +264,8 @@ type OVNKubernetesConfig struct {
// mtu is the MTU to use for the tunnel interface. This must be 100
// bytes smaller than the uplink mtu.
// Default is 1400
// +kubebuilder:validation:Minimum=0
// +optional
MTU *uint32 `json:"mtu,omitempty"`
}

Expand Down

0 comments on commit f6c477b

Please sign in to comment.