Skip to content

Conversation

@huntergregory
Copy link
Contributor

Adds logic for adding/removing sets to kernel in ipsetmanger and changes the dataplane API to not use IPSets

Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

We will need think about bulk inputs, i think bulk inputs will complicate the controllers. We can take it up as a separate work item.

Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

we do not have to fix these now, just for note keeping purposes

iMgr.Lock()
defer iMgr.Unlock()
if iMgr.exists(setName) {
return npmerrors.Errorf(npmerrors.CreateIPSet, false, fmt.Sprintf("ipset %s already exists", setName))
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a no-op, return nil. in which case, we can remove error return on this whole function

iMgr.Lock()
defer iMgr.Unlock()
if !iMgr.exists(name) {
return npmerrors.Errorf(npmerrors.DestroyIPSet, false, fmt.Sprintf("ipset %s does not exist", name))
Copy link
Contributor

Choose a reason for hiding this comment

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

should be no-op with a warning message,


set := iMgr.setMap[name]
if !set.canBeDeleted() {
return npmerrors.Errorf(npmerrors.DeleteIPSet, false, fmt.Sprintf("ipset %s cannot be deleted", name))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to have some error codes so the caller can decide what to do with this error, may be not in this case, but in some scenarios caller needs to decide if the error is a no-op or legitimate retry mechanism

Copy link
Contributor

@vakalapa vakalapa left a comment

Choose a reason for hiding this comment

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

more iterations to come!

@huntergregory huntergregory merged commit 6c947e2 into master Sep 29, 2021
@huntergregory huntergregory deleted the ipsetmanager-update branch September 29, 2021 18:33
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.

3 participants