-
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
Refactor v1beta3 - Refactor 'Metadata' to ObjectMeta from all types #2102
Refactor v1beta3 - Refactor 'Metadata' to ObjectMeta from all types #2102
Conversation
Is there some history on why we're doing this? |
@@ -473,7 +473,7 @@ type PodStatus struct { | |||
// to hosts. | |||
type Pod struct { | |||
TypeMeta `json:",inline" yaml:",inline"` | |||
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` | |||
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` |
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.
Don't all these need to say "inline" rather than "omitempty"?
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.
Nevermind. @smarterclayton is right. This should stay omitempty, so that the serialization doesn't change.
1fce6c5
to
90c436f
Compare
For reference, discussion on IRC about benefits of leaving JSON serialization as "metadata" vs code benefits internally of embedding the type https://botbot.me/freenode/google-containers/msg/24613191/ |
9fd2641
to
9140d83
Compare
LGTM |
@@ -486,7 +486,7 @@ type Pod struct { | |||
// PodList is a list of Pods. | |||
type PodList struct { | |||
TypeMeta `json:",inline" yaml:",inline"` | |||
Metadata ListMeta `json:"metadata" yaml:"metadata"` | |||
ListMeta `json:"metadata" yaml:"metadata"` |
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.
Why does listmeta not get omitempty?
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.
No good reason, AFAIK. Didn't have it before. Probably oversight during the big v1beta3 PR.
9140d83
to
b44add9
Compare
I added "omitempty" to each ListMeta that was missing it. |
LGTM |
LGTM, though I fall in the "prefer to inline it" camp, I'll cope. |
b44add9
to
2260b24
Compare
Merging before we reopen all other design discussions :) |
Refactor v1beta3 - Refactor 'Metadata' to ObjectMeta from all types
…ockerfile WRKLDS-1449: Update Hyperkube Dockerfile with the right Kubernetes version
Removed "Metadata" from all domain objects, leaving just "ObjectMeta" with each.