-
Notifications
You must be signed in to change notification settings - Fork 260
fix: [CNI] handle getting endpoints when state file is empty #916
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
Conversation
4781851 to
40fc997
Compare
40fc997 to
97991e8
Compare
neaggarwMS
left a comment
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.
![]()
store/json.go
Outdated
|
|
||
| if len(b) == 0 { | ||
| log.Printf("Unable to read file %s, was empty", kvs.fileName) | ||
| return 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.
i would suggest return ErrEmptyFile and handle this in restore function (network/manager.go and ipam/manager.go) as like ErrKeyNotFound
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.
@tamilmani1989 , this store file is also read by CNS to save CNS state, if are returning error then we need to handle it in there as well.
tamilmani1989
left a comment
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.
lgtm
neaggarwMS
left a comment
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.
![]()
Reason for Change:
When reconciling with CNI, it may be the case that CNI state hasn't been created yet. Don't block consumers of that state when empty.
Issue Fixed:
Requirements:
Notes: