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

Remove duplicated IPAM code #135

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wazsone
Copy link
Contributor

@wazsone wazsone commented Jan 11, 2023

@wazsone wazsone force-pushed the feature/remove-duplicated-ipam-code branch from 09c07e3 to 042c9c7 Compare January 11, 2023 06:36
Signed-off-by: Ruslan Bayandinov <[email protected]>
@wazsone wazsone force-pushed the feature/remove-duplicated-ipam-code branch from 042c9c7 to b4bfb22 Compare January 11, 2023 06:56
@wazsone wazsone marked this pull request as ready for review January 11, 2023 07:02
main.go Outdated
@@ -157,7 +155,7 @@ func main() {
log.FromContext(ctx).Infof("executing phase 3: parsing network prefixes for ipam")
// ********************************************************************************

ipamChain := getIPAMChain(ctx, cfg.CidrPrefix)
ipamChain := groupipam.NewServer(cfg.CidrPrefix)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ipamChain := groupipam.NewServer(cfg.CidrPrefix)

Copy link
Member

Choose a reason for hiding this comment

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

Please do it inline at 170

Also note, that here we should use singlepointipam.

Consider to use option groupipam.WithCustomImapServer(singlepointipam.NewServer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: Ruslan Bayandinov <[email protected]>
Signed-off-by: Ruslan Bayandinov <[email protected]>
Comment on lines +113 to +115
if len(cfg.CidrPrefix) != 1 {
logrus.Fatal("Only one CIDR prefix group expected")
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to check it?

Copy link
Contributor Author

@wazsone wazsone Jan 23, 2023

Choose a reason for hiding this comment

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

@denis-tingaikin As far as I remember we discussed to add this check because we had agreed on changing CidrPrefix type from []string to cidr.Groups.

@denis-tingaikin
Copy link
Member

@zolug Would you have a look at these changes? Don't you mind if we go with this approach?

@zolug
Copy link

zolug commented Jan 23, 2023

@zolug Would you have a look at these changes? Don't you mind if we go with this approach?

Hi!
I will look at it, but honestly any config change that is not backward compatible is generally not welcomed.
I haven't checked yet what cidr.Groups is all about, but we do require IPv4 and IPv6 address allocation at the same time using the same NSE.
I would also prefer if this change could be postponed at least until we settle the way forward for the IP range IPAM configuration option.

@denis-tingaikin
Copy link
Member

denis-tingaikin commented Jan 26, 2023

@zolug Agreed, lets postpone this for cmd-nse-remote-vlan

@denis-tingaikin denis-tingaikin marked this pull request as draft January 26, 2023 09:10
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