-
Notifications
You must be signed in to change notification settings - Fork 62
Fix/zone networks empty array #257
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
base: v2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked nicely in my test:
create nil -> []
update [0] -> [0]
update nil -> [0]
update [] -> []
Just a comment
| if aux.Networks == nil { | ||
| aux.Networks = &[]int{} | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't make assumptions on the value of Networks, and just force it to nil if NetworkIDs is nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly if we do that the first line becomes
create nil -> [0]
Which is the same behaviour we had with NetworksId (it's intended)
| } | ||
|
|
||
| if aux.Networks == nil { | ||
| aux.Networks = &[]int{} | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arnavbhattacharya-NS1 can you do this?
| } | |
| if aux.Networks == nil { | |
| aux.Networks = &[]int{} | |
| } | |
| } else { | |
| aux.Networks = nil | |
| } |
fix for when a zone is created with the
networks=[]. The created zone was being attached Network 0(as it gets added to it by default when nonetworksfield is used)