Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func TestInitRequestController(t *testing.T) {
},
},
SubnetAddressSpace: subnetRange,
Version: "1",
Version: 1,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion cns/requestcontroller/kubecontroller/crdtranslator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func CRDStatusToNCRequest(crdStatus nnc.NodeNetworkConfigStatus) (cns.CreateNetw
ncRequest.SecondaryIPConfigs = make(map[string]cns.SecondaryIPConfig)
ncRequest.NetworkContainerid = nc.ID
ncRequest.NetworkContainerType = cns.Docker
ncRequest.Version = nc.Version
ncRequest.Version = strconv.FormatInt(nc.Version, 10)

if ip = net.ParseIP(nc.PrimaryIP); ip == nil {
return ncRequest, fmt.Errorf("Invalid PrimaryIP %s:", nc.PrimaryIP)
Expand Down
8 changes: 3 additions & 5 deletions cns/requestcontroller/kubecontroller/crdtranslator_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package kubecontroller

import (
"strconv"
"testing"

"github.com/Azure/azure-container-networking/cns"
Expand All @@ -18,7 +17,7 @@ const (
subnetAddressSpace = "10.0.0.0/24"
subnetPrefixLen = 24
testSecIp1 = "10.0.0.2"
version = "1"
version = 1
)

func TestStatusToNCRequestMalformedPrimaryIP(t *testing.T) {
Expand Down Expand Up @@ -237,8 +236,7 @@ func TestStatusToNCRequestSuccess(t *testing.T) {
t.Fatalf("Expected %v as the secondary IP config but got %v", testSecIp1, secondaryIP.IPAddress)
}

ncVersionInInt, _ := strconv.Atoi(version)
if secondaryIP.NCVersion != ncVersionInInt {
t.Fatalf("Expected %d as the secondary IP config NC version but got %v", ncVersionInInt, secondaryIP.NCVersion)
if secondaryIP.NCVersion != version {
t.Fatalf("Expected %d as the secondary IP config NC version but got %v", version, secondaryIP.NCVersion)
}
}
2 changes: 1 addition & 1 deletion nodenetworkconfig/api/v1alpha/nodenetworkconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type NetworkContainer struct {
IPAssignments []IPAssignment `json:"ipAssignments,omitempty"`
DefaultGateway string `json:"defaultGateway,omitempty"`
SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"`
Version string `json:"version,omitempty"`
Version int64 `json:"version,omitempty"`
}

// IPAssignment groups an IP address and Name. Name is a UUID set by the the IP address assigner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ spec:
subnetName:
type: string
version:
type: string
format: int64
type: integer
type: object
type: array
scaler:
Expand Down