Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

fix: OnlyReservations flag not respected #184

Closed
wants to merge 1 commit into from

Conversation

wideblue
Copy link

Fixes issue #176

This is based on the code that was opensource. Leases pick strategy (pickStrategies) is chosen based on the Subnet.Pickers values. Subnet.Pickers values are set with Subnet.Fill() function, if s.Pickers are already set the OnlyReservations flag will not be respected. Something sets s.Pickers to ["hint", "nextFree", "mostExpired"] on subnet creation even with s.OnlyReservations true.

@wideblue wideblue changed the title fix: OnlyReservations flag not respected #176 fix: OnlyReservations flag not respected Mar 24, 2020
@wideblue
Copy link
Author

Did some more testing and analysis. If subnet is created trough GUI by choosing network interface the s.Pickers is set to ["hint", "nextFree", "mostExpired"] even with s.OnlyReservations true. If subnet is created trough CLI where s.Pickers is ["none"] or not present, the OnlyReservations true is respected. I haven't tested, but I expect there would be a problem if the value OnlyReservations would change trough GUI, because the s.Pickers would not change appropriately if it is not nil.

There is an option to change Pickers trough CLI, which allows change that is not according to OnlyReservations flag. I think the condition that is removed in my PR was there to allow this inconsistent behavior between values of Pickers and OnlyReservations.

I also noticed that OnlyReservations true behaviour is not respected even with Pickers "none" when Proxy mode is enabled.

@galthaus
Copy link
Contributor

@VictorLowther - Can you review this? I think you may have fixed this a different way in the backend server.

@VictorLowther
Copy link
Contributor

This will be resolved in v4.2.7. Subnets with the OnlyReservations flag will not be considered when creating a new Lease or renewing one after lease timeout.

@VictorLowther
Copy link
Contributor

The fix as presented here is not valid because we have a couple of custom Pickers for specialized use cases that this change would break by not letting them be set at subnet creation time.

@wideblue wideblue deleted the fix-only-reservations branch March 31, 2020 07:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants