],
"providerNetType": "VLAN",
"vlan": {
- "vlanId": 100,
+ "vlanId": "100",
"providerInterfaceName": "eth1",
"logicalInterfaceName": "eth1.100",
"vlanNodeSelector": "specific",
}
// validate the VLAN ID
- errs = validation.IsValidNumber(p.Spec.Vlan.VlanId, 0, 4095)
+ errs = validation.IsValidNumberStr(p.Spec.Vlan.VlanId, 0, 4095)
if len(errs) > 0 {
return pkgerrors.Errorf("Invalid VlAN ID %v - error: %v", p.Spec.Vlan.VlanId, errs)
}
var VLAN_NODE_SELECTORS = [...]string{VLAN_NODE_ANY, VLAN_NODE_SPECIFIC}
type Vlan struct {
- VlanId int `json:"vlanID" yaml:"vlanId"`
+ VlanId string `json:"vlanID" yaml:"vlanId"`
ProviderInterfaceName string `json:"providerInterfaceName" yaml:"providerInterfaceName"`
LogicalInterfaceName string `json:"logicalInterfaceName" yaml:"logicalInterfaceName"`
VlanNodeSelector string `json:"vlanNodeSelector" yaml:"vlanNodeSelector"`
}
type NetworkSpec struct {
- CniType string `json:"cniType"`
- Ipv4Subnets []Ipv4Subnet `json:"ipv4Subnets"`
+ CniType string `json:"cniType" yaml:"cniType"`
+ Ipv4Subnets []Ipv4Subnet `json:"ipv4Subnets" yaml:"ipv4Subnets"`
}
// NetworkKey is the key structure that is used in the database
// structure for the Network Custom Resource
type CrNetwork struct {
- ApiVersion string `yaml:"apiVersion"`
- Kind string `yaml:"kind"`
- Network Network
+ ApiVersion string `yaml:"apiVersion"`
+ Kind string `yaml:"kind"`
+ Network Network `yaml:",inline"`
}
const NETWORK_APIVERSION = "k8s.plugin.opnfv.org/v1alpha1"
// structure for the Network Custom Resource
type CrProviderNet struct {
- ApiVersion string `yaml:"apiVersion"`
- Kind string `yaml:"kind"`
- ProviderNet ProviderNet
+ ApiVersion string `yaml:"apiVersion"`
+ Kind string `yaml:"kind"`
+ ProviderNet ProviderNet `yaml:",inline"`
}
const PROVIDER_NETWORK_APIVERSION = "k8s.plugin.opnfv.org/v1alpha1"