Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the field of network entity. #32

Merged
merged 8 commits into from
Jun 24, 2018
Merged

Refactor the field of network entity. #32

merged 8 commits into from
Jun 24, 2018

Conversation

hwchiu
Copy link
Contributor

@hwchiu hwchiu commented Jun 23, 2018

We replace the "BridgeName" and "DisplayName" by "Name" now.
Use can create duplicated name on different node but can't in the same node.

@@ -7,6 +7,7 @@ import (
"strings"
"testing"

"github.com/docker/docker/pkg/namesgenerator"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/moby/moby/pkg/namesgenerator and don't forget add to vendor.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it already add.

@@ -28,6 +28,10 @@ func CreateNetworkHandler(ctx *web.Context) {
}

session := as.Mongo.NewSession()
session.C(entity.NetworkCollectionName).EnsureIndex(mgo.Index{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to document

Deprecated since version 3.0.0: db.collection.ensureIndex() is now an alias for db.collection.createIndex().

does mgo support createIndex() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on, only ensureIndex.

@@ -18,8 +18,7 @@ type PhysicalPort struct {

type Network struct {
ID bson.ObjectId `bson:"_id,omitempty" json:"id"`
DisplayName string `bson:"displayName" json:"displayName"`
BridgeName string `bson:"bridgeName" json:"bridgeName"`
Name string `bson:"name" json:"name"`
BridgeType string `bson:"bridgeType" json:"bridgeType"`
Node string `bson:"node" json:"node"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use NodeName here

@@ -18,8 +18,7 @@ type PhysicalPort struct {

type Network struct {
ID bson.ObjectId `bson:"_id,omitempty" json:"id"`
DisplayName string `bson:"displayName" json:"displayName"`
BridgeName string `bson:"bridgeName" json:"bridgeName"`
Name string `bson:"name" json:"name"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this BridgeName?

BridgeName string `bson:"bridgeName" json:"bridgeName"`
BridgeType string `bson:"bridgeType" json:"bridgeType"`
Node string `bson:"node" json:"node"`
NodeName string `bson:"node" json:"node"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bson:"nodeName" json:"nodeName"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

話說目前除了 Bridge/OVS 外,還有其他的網路可能性嗎?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前只支援這兩個虛擬交換機吧. 但這個留言是想說你的bson沒改到

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩恩,我有看到lol,那我們就先暫時只支援交換機類型的,之後要別的類型要在改

@codecov-io
Copy link

codecov-io commented Jun 23, 2018

Codecov Report

Merging #32 into develop will increase coverage by 14.06%.
The diff coverage is 57.14%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop      #32       +/-   ##
============================================
+ Coverage    62.32%   76.38%   +14.06%     
============================================
  Files           14       13        -1     
  Lines          361      288       -73     
============================================
- Hits           225      220        -5     
+ Misses         124       60       -64     
+ Partials        12        8        -4
Impacted Files Coverage Δ
src/server/route.go 48.14% <ø> (-1.86%) ⬇️
src/server/handler_storage_provider.go 92.59% <100%> (+0.59%) ⬆️
src/server/handler_network.go 84.61% <52.63%> (+38.92%) ⬆️
src/kubernetes/nodes.go 80% <0%> (-10%) ⬇️
src/kubernetes/kubectl.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1768230...4483a7f. Read the comment docs.

@hwchiu hwchiu changed the title [WIP] Refactor the field of network entity. Refactor the field of network entity. Jun 23, 2018
@hwchiu
Copy link
Contributor Author

hwchiu commented Jun 23, 2018

.... 我晚點修一下這個,重開

@John-Lin
Copy link
Contributor

這是推錯嗎? 看起來怪怪的

@hwchiu
Copy link
Contributor Author

hwchiu commented Jun 23, 2018

@John-Lin fix to nodeName

@hwchiu hwchiu merged commit 253e7e4 into develop Jun 24, 2018
@John-Lin John-Lin deleted the hwchiu/VX-127 branch June 25, 2018 09:39
John-Lin pushed a commit that referenced this pull request Jul 25, 2018
Refactor the field of network entity.

Former-commit-id: 943f4232d65b8024df1353b9b339a3c657711a3f [formerly 253e7e4]
Former-commit-id: 491c1a812f15fd4d30d7e446231888dffdc3aad9
John-Lin pushed a commit that referenced this pull request Jul 25, 2018
Refactor the field of network entity.

Former-commit-id: 943f4232d65b8024df1353b9b339a3c657711a3f [formerly 943f4232d65b8024df1353b9b339a3c657711a3f [formerly 253e7e4]]
Former-commit-id: 491c1a812f15fd4d30d7e446231888dffdc3aad9
Former-commit-id: 6c4ec42
John-Lin pushed a commit that referenced this pull request Jul 25, 2018
Refactor the field of network entity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants