Moving Status object to a common package

This commit is contained in:
Kris
2015-09-09 14:59:11 -07:00
committed by Chao Xu
parent a32ea8ebc1
commit f4ad00d9ae
84 changed files with 960 additions and 1101 deletions

View File

@@ -23,6 +23,7 @@ import (
api "k8s.io/kubernetes/pkg/api"
resource "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
)
@@ -896,9 +897,9 @@ func convert_api_List_To_v1_List(in *api.List, out *List, s conversion.Scope) er
return nil
}
func convert_api_ListMeta_To_v1_ListMeta(in *api.ListMeta, out *ListMeta, s conversion.Scope) error {
func convert_api_ListMeta_To_v1_ListMeta(in *unversioned.ListMeta, out *unversioned.ListMeta, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.ListMeta))(in)
defaulting.(func(*unversioned.ListMeta))(in)
}
out.SelfLink = in.SelfLink
out.ResourceVersion = in.ResourceVersion
@@ -2247,9 +2248,9 @@ func convert_api_ServiceStatus_To_v1_ServiceStatus(in *api.ServiceStatus, out *S
return nil
}
func convert_api_Status_To_v1_Status(in *api.Status, out *Status, s conversion.Scope) error {
func convert_api_Status_To_v1_Status(in *unversioned.Status, out *unversioned.Status, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.Status))(in)
defaulting.(func(*unversioned.Status))(in)
}
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
@@ -2259,9 +2260,9 @@ func convert_api_Status_To_v1_Status(in *api.Status, out *Status, s conversion.S
}
out.Status = in.Status
out.Message = in.Message
out.Reason = StatusReason(in.Reason)
out.Reason = unversioned.StatusReason(in.Reason)
if in.Details != nil {
out.Details = new(StatusDetails)
out.Details = new(unversioned.StatusDetails)
if err := convert_api_StatusDetails_To_v1_StatusDetails(in.Details, out.Details, s); err != nil {
return err
}
@@ -2272,24 +2273,24 @@ func convert_api_Status_To_v1_Status(in *api.Status, out *Status, s conversion.S
return nil
}
func convert_api_StatusCause_To_v1_StatusCause(in *api.StatusCause, out *StatusCause, s conversion.Scope) error {
func convert_api_StatusCause_To_v1_StatusCause(in *unversioned.StatusCause, out *unversioned.StatusCause, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.StatusCause))(in)
defaulting.(func(*unversioned.StatusCause))(in)
}
out.Type = CauseType(in.Type)
out.Type = unversioned.CauseType(in.Type)
out.Message = in.Message
out.Field = in.Field
return nil
}
func convert_api_StatusDetails_To_v1_StatusDetails(in *api.StatusDetails, out *StatusDetails, s conversion.Scope) error {
func convert_api_StatusDetails_To_v1_StatusDetails(in *unversioned.StatusDetails, out *unversioned.StatusDetails, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.StatusDetails))(in)
defaulting.(func(*unversioned.StatusDetails))(in)
}
out.Name = in.Name
out.Kind = in.Kind
if in.Causes != nil {
out.Causes = make([]StatusCause, len(in.Causes))
out.Causes = make([]unversioned.StatusCause, len(in.Causes))
for i := range in.Causes {
if err := convert_api_StatusCause_To_v1_StatusCause(&in.Causes[i], &out.Causes[i], s); err != nil {
return err
@@ -2312,9 +2313,9 @@ func convert_api_TCPSocketAction_To_v1_TCPSocketAction(in *api.TCPSocketAction,
return nil
}
func convert_api_TypeMeta_To_v1_TypeMeta(in *api.TypeMeta, out *TypeMeta, s conversion.Scope) error {
func convert_api_TypeMeta_To_v1_TypeMeta(in *unversioned.TypeMeta, out *unversioned.TypeMeta, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.TypeMeta))(in)
defaulting.(func(*unversioned.TypeMeta))(in)
}
out.Kind = in.Kind
out.APIVersion = in.APIVersion
@@ -3331,9 +3332,9 @@ func convert_v1_List_To_api_List(in *List, out *api.List, s conversion.Scope) er
return nil
}
func convert_v1_ListMeta_To_api_ListMeta(in *ListMeta, out *api.ListMeta, s conversion.Scope) error {
func convert_v1_ListMeta_To_api_ListMeta(in *unversioned.ListMeta, out *unversioned.ListMeta, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*ListMeta))(in)
defaulting.(func(*unversioned.ListMeta))(in)
}
out.SelfLink = in.SelfLink
out.ResourceVersion = in.ResourceVersion
@@ -4682,9 +4683,9 @@ func convert_v1_ServiceStatus_To_api_ServiceStatus(in *ServiceStatus, out *api.S
return nil
}
func convert_v1_Status_To_api_Status(in *Status, out *api.Status, s conversion.Scope) error {
func convert_v1_Status_To_api_Status(in *unversioned.Status, out *unversioned.Status, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*Status))(in)
defaulting.(func(*unversioned.Status))(in)
}
if err := convert_v1_TypeMeta_To_api_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
@@ -4694,9 +4695,9 @@ func convert_v1_Status_To_api_Status(in *Status, out *api.Status, s conversion.S
}
out.Status = in.Status
out.Message = in.Message
out.Reason = api.StatusReason(in.Reason)
out.Reason = unversioned.StatusReason(in.Reason)
if in.Details != nil {
out.Details = new(api.StatusDetails)
out.Details = new(unversioned.StatusDetails)
if err := convert_v1_StatusDetails_To_api_StatusDetails(in.Details, out.Details, s); err != nil {
return err
}
@@ -4707,24 +4708,24 @@ func convert_v1_Status_To_api_Status(in *Status, out *api.Status, s conversion.S
return nil
}
func convert_v1_StatusCause_To_api_StatusCause(in *StatusCause, out *api.StatusCause, s conversion.Scope) error {
func convert_v1_StatusCause_To_api_StatusCause(in *unversioned.StatusCause, out *unversioned.StatusCause, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*StatusCause))(in)
defaulting.(func(*unversioned.StatusCause))(in)
}
out.Type = api.CauseType(in.Type)
out.Type = unversioned.CauseType(in.Type)
out.Message = in.Message
out.Field = in.Field
return nil
}
func convert_v1_StatusDetails_To_api_StatusDetails(in *StatusDetails, out *api.StatusDetails, s conversion.Scope) error {
func convert_v1_StatusDetails_To_api_StatusDetails(in *unversioned.StatusDetails, out *unversioned.StatusDetails, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*StatusDetails))(in)
defaulting.(func(*unversioned.StatusDetails))(in)
}
out.Name = in.Name
out.Kind = in.Kind
if in.Causes != nil {
out.Causes = make([]api.StatusCause, len(in.Causes))
out.Causes = make([]unversioned.StatusCause, len(in.Causes))
for i := range in.Causes {
if err := convert_v1_StatusCause_To_api_StatusCause(&in.Causes[i], &out.Causes[i], s); err != nil {
return err
@@ -4747,9 +4748,9 @@ func convert_v1_TCPSocketAction_To_api_TCPSocketAction(in *TCPSocketAction, out
return nil
}
func convert_v1_TypeMeta_To_api_TypeMeta(in *TypeMeta, out *api.TypeMeta, s conversion.Scope) error {
func convert_v1_TypeMeta_To_api_TypeMeta(in *unversioned.TypeMeta, out *unversioned.TypeMeta, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*TypeMeta))(in)
defaulting.(func(*unversioned.TypeMeta))(in)
}
out.Kind = in.Kind
out.APIVersion = in.APIVersion

View File

@@ -23,6 +23,7 @@ import (
api "k8s.io/kubernetes/pkg/api"
resource "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
runtime "k8s.io/kubernetes/pkg/runtime"
util "k8s.io/kubernetes/pkg/util"
@@ -790,7 +791,7 @@ func deepCopy_v1_List(in List, out *List, c *conversion.Cloner) error {
return nil
}
func deepCopy_v1_ListMeta(in ListMeta, out *ListMeta, c *conversion.Cloner) error {
func deepCopy_v1_ListMeta(in unversioned.ListMeta, out *unversioned.ListMeta, c *conversion.Cloner) error {
out.SelfLink = in.SelfLink
out.ResourceVersion = in.ResourceVersion
return nil
@@ -2030,7 +2031,7 @@ func deepCopy_v1_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *conversi
return nil
}
func deepCopy_v1_Status(in Status, out *Status, c *conversion.Cloner) error {
func deepCopy_v1_Status(in unversioned.Status, out *unversioned.Status, c *conversion.Cloner) error {
if err := deepCopy_v1_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
@@ -2041,7 +2042,7 @@ func deepCopy_v1_Status(in Status, out *Status, c *conversion.Cloner) error {
out.Message = in.Message
out.Reason = in.Reason
if in.Details != nil {
out.Details = new(StatusDetails)
out.Details = new(unversioned.StatusDetails)
if err := deepCopy_v1_StatusDetails(*in.Details, out.Details, c); err != nil {
return err
}
@@ -2052,18 +2053,18 @@ func deepCopy_v1_Status(in Status, out *Status, c *conversion.Cloner) error {
return nil
}
func deepCopy_v1_StatusCause(in StatusCause, out *StatusCause, c *conversion.Cloner) error {
func deepCopy_v1_StatusCause(in unversioned.StatusCause, out *unversioned.StatusCause, c *conversion.Cloner) error {
out.Type = in.Type
out.Message = in.Message
out.Field = in.Field
return nil
}
func deepCopy_v1_StatusDetails(in StatusDetails, out *StatusDetails, c *conversion.Cloner) error {
func deepCopy_v1_StatusDetails(in unversioned.StatusDetails, out *unversioned.StatusDetails, c *conversion.Cloner) error {
out.Name = in.Name
out.Kind = in.Kind
if in.Causes != nil {
out.Causes = make([]StatusCause, len(in.Causes))
out.Causes = make([]unversioned.StatusCause, len(in.Causes))
for i := range in.Causes {
if err := deepCopy_v1_StatusCause(in.Causes[i], &out.Causes[i], c); err != nil {
return err
@@ -2083,7 +2084,7 @@ func deepCopy_v1_TCPSocketAction(in TCPSocketAction, out *TCPSocketAction, c *co
return nil
}
func deepCopy_v1_TypeMeta(in TypeMeta, out *TypeMeta, c *conversion.Cloner) error {
func deepCopy_v1_TypeMeta(in unversioned.TypeMeta, out *unversioned.TypeMeta, c *conversion.Cloner) error {
out.Kind = in.Kind
out.APIVersion = in.APIVersion
return nil

View File

@@ -19,6 +19,7 @@ package v1
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/registered"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
)
@@ -54,7 +55,6 @@ func addKnownTypes() {
&Node{},
&NodeList{},
&Binding{},
&Status{},
&Event{},
&EventList{},
&List{},
@@ -86,6 +86,13 @@ func addKnownTypes() {
&ThirdPartyResourceList{},
&ThirdPartyResourceData{},
)
// Add common types
api.Scheme.AddKnownTypes("v1", &unversioned.Status{})
// Legacy names are supported
api.Scheme.AddKnownTypeWithName("v1", "Minion", &Node{})
api.Scheme.AddKnownTypeWithName("v1", "MinionList", &NodeList{})
}
func (*Pod) IsAnAPIObject() {}
@@ -102,7 +109,6 @@ func (*EndpointsList) IsAnAPIObject() {}
func (*Node) IsAnAPIObject() {}
func (*NodeList) IsAnAPIObject() {}
func (*Binding) IsAnAPIObject() {}
func (*Status) IsAnAPIObject() {}
func (*Event) IsAnAPIObject() {}
func (*EventList) IsAnAPIObject() {}
func (*List) IsAnAPIObject() {}

View File

@@ -18,6 +18,7 @@ package v1
import (
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
@@ -62,41 +63,6 @@ import (
// Hypens ('-') cannot be leading or trailing character of the string
// and cannot be adjacent to other hyphens.
// TypeMeta describes an individual object in an API response or request
// with strings representing the type of the object and its API schema version.
// Structures that are versioned or persisted should inline TypeMeta.
type TypeMeta struct {
// A string value representing the REST resource this object represents.
// Servers may infer this from the endpoint the client submits requests to.
// Cannot be updated.
// In CamelCase.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// APIVersion defines the version of the schema of an object.
// Servers should convert recognized schemas to the latest internal value, and
// may reject unrecognized values.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources
APIVersion string `json:"apiVersion,omitempty"`
}
// ListMeta describes metadata that synthetic resources must have, including lists and
// various status objects.
type ListMeta struct {
// SelfLink is a URL representing this object.
// Populated by the system.
// Read-only.
SelfLink string `json:"selfLink,omitempty"`
// String that identifies the server's internal version of this object that
// can be used by clients to determine when objects have changed.
// Value must be treated as opaque by clients and passed unmodified back to the server.
// Populated by the system.
// Read-only.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency
ResourceVersion string `json:"resourceVersion,omitempty"`
}
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
// users must create.
type ObjectMeta struct {
@@ -342,7 +308,7 @@ type PersistentVolumeSource struct {
// It is analogous to a node.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md
type PersistentVolume struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -410,10 +376,10 @@ type PersistentVolumeStatus struct {
// PersistentVolumeList is a list of PersistentVolume items.
type PersistentVolumeList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of persistent volumes.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md
Items []PersistentVolume `json:"items"`
@@ -421,7 +387,7 @@ type PersistentVolumeList struct {
// PersistentVolumeClaim is a user's request for and claim to a persistent volume
type PersistentVolumeClaim struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -438,10 +404,10 @@ type PersistentVolumeClaim struct {
// PersistentVolumeClaimList is a list of PersistentVolumeClaim items.
type PersistentVolumeClaimList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// A list of persistent volume claims.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims
Items []PersistentVolumeClaim `json:"items"`
@@ -1271,7 +1237,7 @@ type PodStatus struct {
// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
type PodStatusResult struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1286,7 +1252,7 @@ type PodStatusResult struct {
// Pod is a collection of containers that can run on a host. This resource is created
// by clients and scheduled onto hosts.
type Pod struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1305,10 +1271,10 @@ type Pod struct {
// PodList is a list of Pods.
type PodList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of pods.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/pods.md
@@ -1328,7 +1294,7 @@ type PodTemplateSpec struct {
// PodTemplate describes a template for creating copies of a predefined pod.
type PodTemplate struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1340,10 +1306,10 @@ type PodTemplate struct {
// PodTemplateList is a list of PodTemplates.
type PodTemplateList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of pod templates
Items []PodTemplate `json:"items"`
@@ -1388,7 +1354,7 @@ type ReplicationControllerStatus struct {
// ReplicationController represents the configuration of a replication controller.
type ReplicationController struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// If the Labels of a ReplicationController are empty, they are defaulted to
// be the same as the Pod(s) that the replication controller manages.
@@ -1409,10 +1375,10 @@ type ReplicationController struct {
// ReplicationControllerList is a collection of replication controllers.
type ReplicationControllerList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of replication controllers.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md
@@ -1556,7 +1522,7 @@ type ServicePort 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"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1580,10 +1546,10 @@ const (
// ServiceList holds a list of services.
type ServiceList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of services
Items []Service `json:"items"`
@@ -1594,7 +1560,7 @@ type ServiceList struct {
// * a principal that can be authenticated and authorized
// * a set of secrets
type ServiceAccount struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1612,10 +1578,10 @@ type ServiceAccount struct {
// ServiceAccountList is a list of ServiceAccount objects
type ServiceAccountList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of ServiceAccounts.
// More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md#service-accounts
@@ -1635,7 +1601,7 @@ type ServiceAccountList struct {
// },
// ]
type Endpoints struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1702,10 +1668,10 @@ type EndpointPort struct {
// EndpointsList is a list of endpoints.
type EndpointsList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of endpoints.
Items []Endpoints `json:"items"`
@@ -1852,7 +1818,7 @@ type ResourceList map[ResourceName]resource.Quantity
// Node is a worker node in Kubernetes, formerly known as minion.
// Each node will have a unique identifier in the cache (i.e. in etcd).
type Node struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1870,10 +1836,10 @@ type Node struct {
// NodeList is the whole list of all Nodes which have been registered with master.
type NodeList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of nodes
Items []Node `json:"items"`
@@ -1913,7 +1879,7 @@ const (
// Namespace provides a scope for Names.
// Use of multiple namespaces is optional.
type Namespace struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1929,10 +1895,10 @@ type Namespace struct {
// NamespaceList is a list of Namespaces.
type NamespaceList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is the list of Namespace objects in the list.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/namespaces.md
@@ -1942,7 +1908,7 @@ type NamespaceList struct {
// Binding ties one object to another.
// For example, a pod is bound to a node by a scheduler.
type Binding struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -1953,7 +1919,7 @@ type Binding struct {
// DeleteOptions may be provided when deleting an API object
type DeleteOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// The duration in seconds before the object should be deleted. Value must be non-negative integer.
// The value zero indicates delete immediately. If this value is nil, the default grace period for the
@@ -1964,7 +1930,7 @@ type DeleteOptions struct {
// ListOptions is the query options to a standard REST list call.
type ListOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// A selector to restrict the list of returned objects by their labels.
// Defaults to everything.
@@ -1982,7 +1948,7 @@ type ListOptions struct {
// PodLogOptions is the query options for a Pod's logs REST call.
type PodLogOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// The container for which to stream logs. Defaults to only container if there is one container in the pod.
Container string `json:"container,omitempty"`
@@ -2001,7 +1967,7 @@ type PodLogOptions struct {
// TODO: merge w/ PodExecOptions below for stdin, stdout, etc
// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY
type PodAttachOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Stdin if true, redirects the standard input stream of the pod for this call.
// Defaults to false.
@@ -2031,7 +1997,7 @@ type PodAttachOptions struct {
// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging
// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY
type PodExecOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Redirect the standard input stream of the pod for this call.
// Defaults to false.
@@ -2059,170 +2025,12 @@ type PodExecOptions struct {
// PodProxyOptions is the query options to a Pod's proxy call.
type PodProxyOptions struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Path is the URL path to use for the current proxy request to pod.
Path string `json:"path,omitempty"`
}
// Status is a return value for calls that don't return other objects.
type Status struct {
TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
// Status of the operation.
// One of: "Success" or "Failure".
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
Status string `json:"status,omitempty"`
// A human-readable description of the status of this operation.
Message string `json:"message,omitempty"`
// A machine-readable description of why this operation is in the
// "Failure" status. If this value is empty there
// is no information available. A Reason clarifies an HTTP status
// code but does not override it.
Reason StatusReason `json:"reason,omitempty"`
// Extended data associated with the reason. Each reason may define its
// own extended details. This field is optional and the data returned
// is not guaranteed to conform to any schema except that defined by
// the reason type.
Details *StatusDetails `json:"details,omitempty"`
// Suggested HTTP return code for this status, 0 if not set.
Code int `json:"code,omitempty"`
}
// StatusDetails is a set of additional properties that MAY be set by the
// server to provide additional information about a response. The Reason
// field of a Status object defines what attributes will be set. Clients
// must ignore fields that do not match the defined type of each attribute,
// and should assume that any attribute may be empty, invalid, or under
// defined.
type StatusDetails struct {
// The name attribute of the resource associated with the status StatusReason
// (when there is a single name which can be described).
Name string `json:"name,omitempty"`
// The kind attribute of the resource associated with the status StatusReason.
// On some operations may differ from the requested resource Kind.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// The Causes array includes more details associated with the StatusReason
// failure. Not all StatusReasons may provide detailed causes.
Causes []StatusCause `json:"causes,omitempty"`
// If specified, the time in seconds before the operation should be retried.
RetryAfterSeconds int `json:"retryAfterSeconds,omitempty"`
}
// Values of Status.Status
const (
StatusSuccess = "Success"
StatusFailure = "Failure"
)
// StatusReason is an enumeration of possible failure causes. Each StatusReason
// must map to a single HTTP status code, but multiple reasons may map
// to the same HTTP status code.
// TODO: move to apiserver
type StatusReason string
const (
// StatusReasonUnknown means the server has declined to indicate a specific reason.
// The details field may contain other information about this error.
// Status code 500.
StatusReasonUnknown StatusReason = ""
// StatusReasonNotFound means one or more resources required for this operation
// could not be found.
// Details (optional):
// "kind" string - the kind attribute of the missing resource
// on some operations may differ from the requested
// resource.
// "id" string - the identifier of the missing resource
// Status code 404
StatusReasonNotFound StatusReason = "NotFound"
// StatusReasonAlreadyExists means the resource you are creating already exists.
// Details (optional):
// "kind" string - the kind attribute of the conflicting resource
// "id" string - the identifier of the conflicting resource
// Status code 409
StatusReasonAlreadyExists StatusReason = "AlreadyExists"
// StatusReasonConflict means the requested update operation cannot be completed
// due to a conflict in the operation. The client may need to alter the request.
// Each resource may define custom details that indicate the nature of the
// conflict.
// Status code 409
StatusReasonConflict StatusReason = "Conflict"
// StatusReasonInvalid means the requested create or update operation cannot be
// completed due to invalid data provided as part of the request. The client may
// need to alter the request. When set, the client may use the StatusDetails
// message field as a summary of the issues encountered.
// Details (optional):
// "kind" string - the kind attribute of the invalid resource
// "id" string - the identifier of the invalid resource
// "causes" - one or more StatusCause entries indicating the data in the
// provided resource that was invalid. The code, message, and
// field attributes will be set.
// Status code 422
StatusReasonInvalid StatusReason = "Invalid"
// StatusReasonServerTimeout means the server can be reached and understood the request,
// but cannot complete the action in a reasonable time. The client should retry the request.
// This is may be due to temporary server load or a transient communication issue with
// another server. Status code 500 is used because the HTTP spec provides no suitable
// server-requested client retry and the 5xx class represents actionable errors.
// Details (optional):
// "kind" string - the kind attribute of the resource being acted on.
// "id" string - the operation that is being attempted.
// Status code 500
StatusReasonServerTimeout StatusReason = "ServerTimeout"
)
// StatusCause provides more information about an api.Status failure, including
// cases when multiple errors are encountered.
type StatusCause struct {
// A machine-readable description of the cause of the error. If this value is
// empty there is no information available.
Type CauseType `json:"reason,omitempty"`
// A human-readable description of the cause of the error. This field may be
// presented as-is to a reader.
Message string `json:"message,omitempty"`
// The field of the resource that has caused this error, as named by its JSON
// serialization. May include dot and postfix notation for nested attributes.
// Arrays are zero-indexed. Fields may appear more than once in an array of
// causes due to fields having multiple errors.
//
// Examples:
// "name" - the field "name" on the current resource
// "items[0].name" - the field "name" on the first array entry in "items"
Field string `json:"field,omitempty"`
}
// CauseType is a machine readable value providing more detail about what
// occurred in a status response. An operation may have multiple causes for a
// status (whether Failure or Success).
type CauseType string
const (
// CauseTypeFieldValueNotFound is used to report failure to find a requested value
// (e.g. looking up an ID).
CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound"
// CauseTypeFieldValueRequired is used to report required values that are not
// provided (e.g. empty strings, null values, or empty arrays).
CauseTypeFieldValueRequired CauseType = "FieldValueRequired"
// CauseTypeFieldValueDuplicate is used to report collisions of values that must be
// unique (e.g. unique IDs).
CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate"
// CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex
// match).
CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid"
// CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules)
// values that can not be handled (e.g. an enumerated string).
CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported"
)
// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
// Kind of the referent.
@@ -2265,7 +2073,7 @@ type LocalObjectReference struct {
// SerializedReference is a reference to serialized object.
type SerializedReference struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// The reference to an object in the system.
Reference ObjectReference `json:"reference,omitempty"`
}
@@ -2281,7 +2089,7 @@ type EventSource 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"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata"`
@@ -2313,10 +2121,10 @@ type Event struct {
// EventList is a list of events.
type EventList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of events
Items []Event `json:"items"`
@@ -2324,10 +2132,10 @@ type EventList struct {
// List holds a list of objects, which may not be known by the server.
type List struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of objects
Items []runtime.RawExtension `json:"items"`
@@ -2367,7 +2175,7 @@ type LimitRangeSpec struct {
// LimitRange sets resource usage limits for each kind of resource in a Namespace.
type LimitRange struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2379,10 +2187,10 @@ type LimitRange struct {
// LimitRangeList is a list of LimitRange items.
type LimitRangeList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of LimitRange objects.
// More info: http://releases.k8s.io/HEAD/docs/design/admission_control_limit_range.md
@@ -2423,7 +2231,7 @@ type ResourceQuotaStatus struct {
// ResourceQuota sets aggregate quota restrictions enforced per namespace
type ResourceQuota struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2439,10 +2247,10 @@ type ResourceQuota struct {
// ResourceQuotaList is a list of ResourceQuota items.
type ResourceQuotaList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of ResourceQuota objects.
// More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota
@@ -2452,7 +2260,7 @@ type ResourceQuotaList struct {
// Secret holds secret data of a certain type. The total bytes of the values in
// the Data field must be less than MaxSecretSize bytes.
type Secret struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2507,10 +2315,10 @@ const (
// SecretList is a list of Secret.
type SecretList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of secret objects.
// More info: http://releases.k8s.io/HEAD/docs/user-guide/secrets.md
@@ -2543,7 +2351,7 @@ type ComponentCondition struct {
// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
type ComponentStatus struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2554,10 +2362,10 @@ type ComponentStatus struct {
// Status of all the conditions for the component as a list of ComponentStatus objects.
type ComponentStatusList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// List of ComponentStatus objects.
Items []ComponentStatus `json:"items"`
@@ -2627,7 +2435,7 @@ type SELinuxOptions struct {
// RangeAllocation is not a public type.
type RangeAllocation struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2641,7 +2449,7 @@ type RangeAllocation struct {
// A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource
// types to the API. It consists of one or more Versions of the api.
type ThirdPartyResource struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`
@@ -2655,10 +2463,10 @@ type ThirdPartyResource struct {
// ThirdPartyResourceList is a list of ThirdPartyResource.
type ThirdPartyResourceList struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ListMeta `json:"metadata,omitempty"`
unversioned.ListMeta `json:"metadata,omitempty"`
// Items is a list of schema objects.
Items []ThirdPartyResource `json:"items"`
@@ -2675,7 +2483,7 @@ type APIVersion struct {
// An internal object, used for versioned storage in etcd. Not exposed to the end user.
type ThirdPartyResourceData struct {
TypeMeta `json:",inline"`
unversioned.TypeMeta `json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
ObjectMeta `json:"metadata,omitempty"`

View File

@@ -528,16 +528,6 @@ func (List) SwaggerDoc() map[string]string {
return map_List
}
var map_ListMeta = map[string]string{
"": "ListMeta describes metadata that synthetic resources must have, including lists and various status objects.",
"selfLink": "SelfLink is a URL representing this object. Populated by the system. Read-only.",
"resourceVersion": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency",
}
func (ListMeta) SwaggerDoc() map[string]string {
return map_ListMeta
}
var map_ListOptions = map[string]string{
"": "ListOptions is the query options to a standard REST list call.",
"labelSelector": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
@@ -1310,43 +1300,6 @@ func (ServiceStatus) SwaggerDoc() map[string]string {
return map_ServiceStatus
}
var map_Status = map[string]string{
"": "Status is a return value for calls that don't return other objects.",
"metadata": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
"status": "Status of the operation. One of: \"Success\" or \"Failure\". More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status",
"message": "A human-readable description of the status of this operation.",
"reason": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.",
"details": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.",
"code": "Suggested HTTP return code for this status, 0 if not set.",
}
func (Status) SwaggerDoc() map[string]string {
return map_Status
}
var map_StatusCause = map[string]string{
"": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.",
"reason": "A machine-readable description of the cause of the error. If this value is empty there is no information available.",
"message": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.",
"field": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"",
}
func (StatusCause) SwaggerDoc() map[string]string {
return map_StatusCause
}
var map_StatusDetails = map[string]string{
"": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
"name": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).",
"kind": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
"causes": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.",
"retryAfterSeconds": "If specified, the time in seconds before the operation should be retried.",
}
func (StatusDetails) SwaggerDoc() map[string]string {
return map_StatusDetails
}
var map_TCPSocketAction = map[string]string{
"": "TCPSocketAction describes an action based on opening a socket",
"port": "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.",
@@ -1387,16 +1340,6 @@ func (ThirdPartyResourceList) SwaggerDoc() map[string]string {
return map_ThirdPartyResourceList
}
var map_TypeMeta = map[string]string{
"": "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.",
"kind": "A string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
"apiVersion": "APIVersion defines the version of the schema of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources",
}
func (TypeMeta) SwaggerDoc() map[string]string {
return map_TypeMeta
}
var map_Volume = map[string]string{
"": "Volume represents a named volume in a pod that may be accessed by any container in the pod.",
"name": "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#names",