Skip to content

Commit

Permalink
Rename and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchiu committed Jul 18, 2018
1 parent 4ca8f17 commit 26e3e82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/entity/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type Container struct {

type PodNetwork struct {
Name string `bson:"name" json:"name"`
IFName string `bson:"ifName" json:"ifName"`
VLAN int `bson:"vlan" json:"vlan"`
IfName string `bson:"ifName" json:"ifName"`
VlanTag int `bson:"vlanTag" json:"vlanTag"`
IPAddress string `bson:"ipAddress json:"ipAddress"`
Netmask string `bson:"netmask" json:"netmask"`
BridgeName string `bson:"bridgeName" json:"bridgeName"` //its from the entity.Network entity
Expand Down
10 changes: 5 additions & 5 deletions src/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func CheckPodParameter(sp *serviceprovider.Container, pod *entity.Pod) error {
if err != nil {
return fmt.Errorf("check the network name error:%v", err)
} else if count == 0 {
return fmt.Errorf("the network name %s doesn't exist", v.Name)
return fmt.Errorf("the network named %s doesn't exist", v.Name)
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ func generateVolume(pod *entity.Pod, session *mongo.Session) ([]corev1.Volume, [
return volumes, volumeMounts, nil
}

//Get the intersecion of nodes' name
//Get the Intersection of nodes' name
func generateNodeLabels(networks []entity.Network) []string {
totalNames := [][]string{}
for _, network := range networks {
Expand All @@ -112,7 +112,7 @@ func generateClientCommand(network entity.PodNetwork) []string {
return []string{
"-s=unix:///tmp/vortex.sock",
"-b=" + network.BridgeName,
"-n=" + network.IFName,
"-n=" + network.IfName,
"-i=" + ip,
}
}
Expand All @@ -123,7 +123,7 @@ func generateInitContainer(networks []entity.PodNetwork) ([]corev1.Container, er
for i, v := range networks {
containers = append(containers, corev1.Container{
Name: fmt.Sprintf("init-network-client-%d", i),
Image: "sdnvortex/network-controller:latest",
Image: "sdnvortex/network-controller:v0.2.1",
Command: []string{"/go/bin/client"},
Args: generateClientCommand(v),
Env: []corev1.EnvVar{
Expand Down Expand Up @@ -164,7 +164,7 @@ func generateInitContainer(networks []entity.PodNetwork) ([]corev1.Container, er
return containers, nil
}

//For the network, we will generate two thins
//For the network, we will generate two things
//[]string => a list of nodes and it will apply on nodeaffinity
//[]corev1.Container => a list of init container we will apply on pod
func generateNetwork(pod *entity.Pod, session *mongo.Session) ([]string, []corev1.Container, error) {
Expand Down
6 changes: 3 additions & 3 deletions src/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (suite *PodTestSuite) TestGenerateClientCommand() {
bName := namesgenerator.GetRandomName(0)
ifName := namesgenerator.GetRandomName(0)
podNetwork := entity.PodNetwork{
IFName: ifName,
IfName: ifName,
IPAddress: "1.2.3.4",
Netmask: "255.255.255.0",
BridgeName: bName,
Expand Down Expand Up @@ -300,7 +300,7 @@ func (suite *PodTestSuite) TestGenerateNetwork() {
Networks: []entity.PodNetwork{
{
Name: networkName,
IFName: ifName,
IfName: ifName,
IPAddress: "1.2.3.4",
Netmask: "255.255.255.0",
},
Expand All @@ -323,7 +323,7 @@ func (suite *PodTestSuite) TestGenerateNetworkFail() {
Networks: []entity.PodNetwork{
{
Name: networkName,
IFName: ifName,
IfName: ifName,
IPAddress: "1.2.3.4",
Netmask: "255.255.255.0",
},
Expand Down

0 comments on commit 26e3e82

Please sign in to comment.