summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ncm/api/providernethandler.go2
-rw-r--r--src/ncm/pkg/module/module_definitions.go2
-rw-r--r--src/ncm/pkg/module/network.go10
-rw-r--r--src/ncm/pkg/module/providernet.go6
4 files changed, 10 insertions, 10 deletions
diff --git a/src/ncm/api/providernethandler.go b/src/ncm/api/providernethandler.go
index b38a16c5..23310c31 100644
--- a/src/ncm/api/providernethandler.go
+++ b/src/ncm/api/providernethandler.go
@@ -80,7 +80,7 @@ func validateProviderNetInputs(p moduleLib.ProviderNet) error {
}
// 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)
}
diff --git a/src/ncm/pkg/module/module_definitions.go b/src/ncm/pkg/module/module_definitions.go
index 36c865a5..8d4b3ad7 100644
--- a/src/ncm/pkg/module/module_definitions.go
+++ b/src/ncm/pkg/module/module_definitions.go
@@ -65,7 +65,7 @@ const VLAN_NODE_SPECIFIC = "specific"
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"`
diff --git a/src/ncm/pkg/module/network.go b/src/ncm/pkg/module/network.go
index cfb414c5..e753905e 100644
--- a/src/ncm/pkg/module/network.go
+++ b/src/ncm/pkg/module/network.go
@@ -29,8 +29,8 @@ type Network struct {
}
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
@@ -42,9 +42,9 @@ type NetworkKey struct {
// 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"
diff --git a/src/ncm/pkg/module/providernet.go b/src/ncm/pkg/module/providernet.go
index 0435f2ba..a1cbe940 100644
--- a/src/ncm/pkg/module/providernet.go
+++ b/src/ncm/pkg/module/providernet.go
@@ -37,9 +37,9 @@ type ProviderNetSpec struct {
// 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"