-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implement rest handler for apiserver #111
Conversation
5900a41
to
129d2f1
Compare
9c3b732
to
7b1213f
Compare
intelli.Status.ErrorCode = crd.Status.ErrorMsg | ||
// todo: need to parse the error code |
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.
intelli.Status.ErrorCode = crd.Status.ErrorMsg | |
// todo: need to parse the error code | |
intelli.Status.ErrorMsg = crd.Status.ErrorMsg | |
// todo: need to parse the error code |
I think you are still working on the error code parsing?
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.
Fixed.
I haven't come up with a good definition and use case of ErrorCode.
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'm fine to remove ErrorCode if it does not have a use case. Would like to get @wsquan171 's thought on this.
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.
Originally the error code was added to facilitate API clients to programmatically react on different types of errors based on error code instead of error msg. For instance, a front end may prompt user differently if the error is by nature invalid input or cluster availability issue. error codes are in general better way to traceback issues in workflows compared to error msg.
For current CLI, since there's little internal retry, and propagating error msg back to stdout is good enough, the use of error code may not be that obvious. For long term serviceability considerations, I still think it's a good-to-have. cc @salv-orlando for more feedback on this.
pkg/apiserver/registry/intelligence/networkpolicyrecommendation/rest.go
Outdated
Show resolved
Hide resolved
pkg/apiserver/registry/intelligence/networkpolicyrecommendation/rest.go
Outdated
Show resolved
Hide resolved
e097e49
to
4b2d8a2
Compare
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.
overall lgtm. one nit.
pkg/apiserver/registry/intelligence/networkpolicyrecommendation/rest.go
Outdated
Show resolved
Hide resolved
60abff0
to
1f04430
Compare
/theia-test-e2e |
f676a60
to
6a6231f
Compare
/theia-test-e2e |
6a6231f
to
6af945e
Compare
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
/theia-test-e2e |
6af945e
to
39e5362
Compare
/theia-test-e2e |
Overall LGTM, just think we need to have a decision on how to deal with the error code before merging. |
820119c
to
86c3190
Compare
Add unit-test Signed-off-by: Yun-Tang Hsu <hsuy@vmware.com>
86c3190
to
c81999a
Compare
Add NetworkPolicyRecommnedation rest handler
Add unit-test for rest.go
Signed-off-by: Yun-Tang Hsu hsuy@vmware.com