-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Return standard API errors from etcd registry by operation #1192
Return standard API errors from etcd registry by operation #1192
Conversation
LGTM for correctness. Thoughts on naming: Even better (though out of scope for this PR), if |
I didn't want to put it in the parent package because I don't think etcd is special in this context - only an etcd registry impl ever needs to know about them.
|
I'd suggest the naming pattern "InterpretXError". I also think the pattern should be that sub packages (like etcd) register error interpretation handlers with the main errors package. @smarterclayton did convince me that we need separate handlers for each of the REST operations, though. |
I guess I don't see enough overlap between registry implementations to justify having a central registry / handler pattern. Etcd errors should never make it out of the Registry interface, much less to storage or clients. |
2c305ef
to
e001059
Compare
Renamed with InterpretXError, still holding out against making a central registry of this vs just being domain specific helpers. |
@@ -20,7 +20,7 @@ import ( | |||
"fmt" | |||
|
|||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" | |||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" | |||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors/etcd" |
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.
Can you import this under a different name? I find it confusing to have an etcd package imported into this etcd package that isn't the real etcd package.
ok, LGTM after import rename :) |
Adds pkg/api/errors/etcd, which defines default conversions for common CRUD operations from etcd to api.
e001059
to
3ffe259
Compare
Import renamed |
Return standard API errors from etcd registry by operation
Adds pkg/api/errors/etcd, which defines default conversions
for common CRUD operations from etcd to api.