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

skel: clean up errors in skel and add some well-known error codes #686

Merged
merged 5 commits into from
Aug 7, 2019

Conversation

mars1024
Copy link
Member

@mars1024 mars1024 commented Jul 3, 2019

ref to #685

@dcbw
Copy link
Member

dcbw commented Jul 3, 2019

@mars1024 Note that the Spec says Errors must be indicated by a non-zero return code and the following JSON being printed to stdout: so we have to print errors to stdout by design. But they can also be (and probably should?) mirrored to stderr.

@squeed
Copy link
Member

squeed commented Jul 3, 2019

Yeah, it would be useful to log the error message to stderr, but I personally don't like logging JSON to stderr.

@jellonek
Copy link
Member

jellonek commented Jul 3, 2019

👍 for not logging JSON. Also if it's log - it would be nice to have a timestamp at least in it.

@mars1024 mars1024 changed the title skel: clean up errors in skel, including unified error code and inherited printer skel: clean up errors in skel, including unified error code Jul 10, 2019
@mars1024 mars1024 changed the title skel: clean up errors in skel, including unified error code [WIP] skel: clean up errors in skel, including unified error code Jul 10, 2019
@mars1024
Copy link
Member Author

I've updated the aims in issue #685 , and i'm going to update this PR soon ~

mars1024 added 4 commits July 15, 2019 20:04
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
@mars1024 mars1024 force-pushed the cleanup/skel_error branch from 759e3cb to 227c438 Compare July 15, 2019 14:51
@mars1024 mars1024 changed the title [WIP] skel: clean up errors in skel, including unified error code skel: clean up errors in skel and add some well-known error codes Jul 15, 2019
@mars1024
Copy link
Member Author

Updated! PTAL, thanks a lot ~ cc @dcbw @squeed @jellonek

Copy link
Member

@jellonek jellonek left a comment

Choose a reason for hiding this comment

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

LGTM

SPEC.md Outdated Show resolved Hide resolved
SPEC.md Outdated Show resolved Hide resolved
SPEC.md Outdated Show resolved Hide resolved
pkg/skel/skel.go Outdated Show resolved Hide resolved
@squeed
Copy link
Member

squeed commented Jul 24, 2019

This is awesome! Thanks for such a great PR.

To make things easier for plugin authors, we'd like there to be just a bit fewer error codes. Because this is changing the spec, we need to live with it "forever." So don't feel disappointed if we have a lot of suggestions.

@mars1024
Copy link
Member Author

This is awesome! Thanks for such a great PR.

To make things easier for plugin authors, we'd like there to be just a bit fewer error codes. Because this is changing the spec, we need to live with it "forever." So don't feel disappointed if we have a lot of suggestions.

Thanks for your appreciation, I'll update this soon ~

@mars1024 mars1024 force-pushed the cleanup/skel_error branch from 4d8a3ab to e09ccfa Compare July 31, 2019 13:35
@jellonek
Copy link
Member

This looks really good!

@mars1024
Copy link
Member Author

Updated! PTAL, thanks ~

SPEC.md Outdated Show resolved Hide resolved
@dcbw
Copy link
Member

dcbw commented Jul 31, 2019

/lgtm after the 8 -> 11

@jellonek
Copy link
Member

Just a note if someone would not understand why we want there 11: http://man7.org/linux/man-pages/man3/errno.3.html and https://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html

#define EAGAIN          11      /* Try again */

;)

@mars1024 mars1024 force-pushed the cleanup/skel_error branch from e09ccfa to 0586094 Compare August 1, 2019 03:19
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
@mars1024 mars1024 force-pushed the cleanup/skel_error branch from 0586094 to 3e79703 Compare August 1, 2019 03:21
@mars1024
Copy link
Member Author

mars1024 commented Aug 1, 2019

Thanks for your suggestion, I've revert index of ErrTryAgainLater to 11, @bboreham @dcbw @jellonek @squeed , PTAL ~

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Thanks!

@dcbw dcbw merged commit 8c6c47d into containernetworking:master Aug 7, 2019
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.

5 participants