Update methods NewGroup, DeleteGroup and GetGroup of OFSwitch#46
Update methods NewGroup, DeleteGroup and GetGroup of OFSwitch#46hongliangl wants to merge 1 commit intoantrea-io:mainfrom
Conversation
wenyingd
left a comment
There was a problem hiding this comment.
Some errors happen with go-lint check, could you check?
3f1b729 to
b791ab7
Compare
Done |
|
Maybe you can split this one into 2 patches: one is for yout group operation changes, and the other is for golangci change; as I see other patches also have been impacted by it. |
Add #48 for this. |
b791ab7 to
88fd066
Compare
88fd066 to
2df2a11
Compare
ofctrl/fgraphSwitch.go
Outdated
| if self.groupDb[groupId] != nil { | ||
| return nil, errors.New("group already exists") | ||
| // NewGroup creates a new group; when using cache, returns an error if the group ID already exists, otherwise returns the | ||
| // group object; when not using cache, returns the new group object, and the caller should ensure the groupID is not |
There was a problem hiding this comment.
| // group object; when not using cache, returns the new group object, and the caller should ensure the groupID is not | |
| // group object; when useCache is false, a new group object is returned and the caller should ensure the groupID is not |
There was a problem hiding this comment.
Thanks.
Not related to this PR: you could select multiple lines when reviewing code on time.
ofctrl/fgraphSwitch.go
Outdated
| // duplicated. | ||
| func (self *OFSwitch) NewGroup(groupID uint32, groupType GroupType, useCache bool) (*Group, error) { | ||
| // Check if the group already exists. | ||
| if useCache { |
There was a problem hiding this comment.
Use this format?
if !useCache {
return newGroup(groupID, groupType, self), nil
}
if self.groupDb[groupID] != nil {
return nil, errors.New("group already exists")
}
return newGroup(groupID, groupType, self), nil
Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
2df2a11 to
1be1913
Compare
|
@hongliangl Could you resolve the conflicts on version changes? |
Add parameter
NewGroupto decide whether to use cache in OFSwitch when create a group.Signed-off-by: Hongliang Liu lhongliang@vmware.com