Skip to content

Commit

Permalink
Merge pull request kubernetes#2102 from markturansky/v1beta3_refactor…
Browse files Browse the repository at this point in the history
…_metadata

Refactor v1beta3 - Refactor 'Metadata' to ObjectMeta from all types
  • Loading branch information
smarterclayton committed Nov 3, 2014
2 parents 808be2d + 2260b24 commit d9c0b45
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ type PodStatus struct {
// by clients and scheduled onto hosts. BoundPod represents the state of this resource
// to hosts.
type Pod struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a pod.
Spec PodSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -486,24 +486,24 @@ 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,omitempty" yaml:"metadata,omitempty"`

Items []Pod `json:"items" yaml:"items"`
}

// PodTemplateSpec describes the data a pod should have when created from a template
type PodTemplateSpec struct {
// Metadata of the pods created from this template.
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a pod.
Spec PodSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
}

// PodTemplate describes a template for creating copies of a predefined pod.
type PodTemplate struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a pod.
Spec PodTemplateSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -512,7 +512,7 @@ type PodTemplate struct {
// PodTemplateList is a list of PodTemplates.
type PodTemplateList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []PodTemplate `json:"items" yaml:"items"`
}
Expand All @@ -521,8 +521,8 @@ type PodTemplateList struct {
// defines how a Pod may change after a Binding is created. A Pod is a request to
// execute a pod, whereas a BoundPod is the specification that would be run on a server.
type BoundPod struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a pod.
Spec PodSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -531,8 +531,8 @@ type BoundPod struct {
// BoundPods is a list of Pods bound to a common server. The resource version of
// the pod list is guaranteed to only change when the list of bound pods changes.
type BoundPods struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Host is the name of a node that these pods were bound to.
Host string `json:"host" yaml:"host"`
Expand Down Expand Up @@ -563,8 +563,8 @@ type ReplicationControllerStatus struct {

// ReplicationController represents the configuration of a replication controller.
type ReplicationController struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the desired behavior of this replication controller.
Spec ReplicationControllerSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -577,7 +577,7 @@ type ReplicationController struct {
// ReplicationControllerList is a collection of replication controllers.
type ReplicationControllerList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []ReplicationController `json:"items" yaml:"items"`
}
Expand Down Expand Up @@ -617,8 +617,8 @@ type ServiceSpec struct {
// (for example 3306) that the proxy listens on, and the selector that determines which pods
// will answer requests sent through the proxy.
type Service struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a service.
Spec ServiceSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -630,16 +630,16 @@ type Service struct {
// ServiceList holds a list of services.
type ServiceList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []Service `json:"items" yaml:"items"`
}

// Endpoints is a collection of endpoints that implement the actual service, for example:
// Name: "mysql", Endpoints: ["10.10.1.1:1909", "10.10.2.2:8834"]
type Endpoints struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata" yaml:"metadata"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata" yaml:"metadata"`

// Endpoints is the list of host ports that satisfy the service selector
Endpoints []string `json:"endpoints" yaml:"endpoints"`
Expand All @@ -648,7 +648,7 @@ type Endpoints struct {
// EndpointsList is a list of endpoints.
type EndpointsList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []Endpoints `json:"items" yaml:"items"`
}
Expand All @@ -675,8 +675,8 @@ type ResourceList map[ResourceName]util.IntOrString
// Node is a worker node in Kubernetenes.
// The name of the node according to etcd is in ID.
type Node struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// Spec defines the behavior of a node.
Spec NodeSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Expand All @@ -691,16 +691,16 @@ type Node struct {
// NodeList is a list of minions.
type NodeList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []Node `json:"items" yaml:"items"`
}

// Binding is written by a scheduler to cause a pod to be bound to a node. Name is not
// required for Bindings.
type Binding struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// PodID is a Pod name to be bound to a node.
PodID string `json:"podID" yaml:"podID"`
Expand All @@ -711,7 +711,7 @@ type Binding struct {
// Status is a return value for calls that don't return other objects.
type Status struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

// One of: "Success", "Failure", "Working" (for operations not yet completed)
Status string `json:"status,omitempty" yaml:"status,omitempty"`
Expand Down Expand Up @@ -866,14 +866,14 @@ const (
// Operation is assigned by the server when an operation is started, and can be used by
// clients to retrieve the final result of the operation at a later time.
type Operation struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata" yaml:"metadata"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata" yaml:"metadata"`
}

// OperationList is a list of operations, as delivered to API clients.
type OperationList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []Operation `json:"items" yaml:"items"`
}
Expand All @@ -900,8 +900,8 @@ type ObjectReference struct {
// Event is a report of an event somewhere in the cluster.
// TODO: Decide whether to store these separately or with the object they apply to.
type Event struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ObjectMeta `json:"metadata" yaml:"metadata"`
TypeMeta `json:",inline" yaml:",inline"`
ObjectMeta `json:"metadata" yaml:"metadata"`

// Required. The object that this event is about.
InvolvedObject ObjectReference `json:"involvedObject,omitempty" yaml:"involvedObject,omitempty"`
Expand Down Expand Up @@ -936,7 +936,7 @@ type Event struct {
// EventList is a list of events.
type EventList struct {
TypeMeta `json:",inline" yaml:",inline"`
Metadata ListMeta `json:"metadata" yaml:"metadata"`
ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

Items []Event `json:"items" yaml:"items"`
}

0 comments on commit d9c0b45

Please sign in to comment.