-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Use codec to encode/decode api objects in client and kubecfg parser #1115
Use codec to encode/decode api objects in client and kubecfg parser #1115
Conversation
LGTM - restarting travis, it's a flake |
b1a4e28
to
0c52f1f
Compare
One note - although this is a good thing to do, I expect that when we get custom api types in other packages, those packages will register themselves with the standard api package, such that everything should Just Work (tm). I'm going to try to do that to the v1beta1 package today. |
0c52f1f
to
bf49013
Compare
@lavalamp - One reason you may not want to reuse the standard api package is if you have your own conversionScheme to handle a different internal/external version for your api. |
@csrwng right, in that case I think you should still register your internal/external types with pkg/api-- then you can work with both. |
if I can haz a rebasez, you can haz a mergez ;) --brendan |
bf49013
to
e51a0b0
Compare
:) done |
@@ -88,13 +88,19 @@ type Client struct { | |||
*RESTClient | |||
} | |||
|
|||
type codec interface { |
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.
Godoc
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.
@smarterclayton - no objection. However, I thought we only added godoc to public interfaces.
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.
In this case it's an interface that clients need to use in order to create a NewRestClient which is public. Actually our stance has been that this should then be a public interface anyway.
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.
done.
e51a0b0
to
c3497ea
Compare
c3497ea
to
3f1a78d
Compare
ugh, @csrwng need another rebase.. I promise I'll get it in super fast this time... Thanks! |
3f1a78d
to
333ceae
Compare
@brendanburns - Thank you, it's updated now. |
@@ -93,13 +93,21 @@ type Client struct { | |||
*RESTClient | |||
} | |||
|
|||
// codec defines methods for serializing and deserializing API | |||
// objects. | |||
type codec interface { |
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.
Sorry to be a pain, but can I talk you into just using the runtime.Codec interface? Since this already links with runtime...
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.
Makes sense. Done.
333ceae
to
6551f4e
Compare
Great, thanks! |
Use codec to encode/decode api objects in client and kubecfg parser
Bug 2026380: Image policy should mutate DeploymentConfigs, StatefulSets, and new CronJobs
The purpose of this change is to allow core parser and client to work with other resource codecs that know how to encode/decode custom types.