mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Remove BoundPods from Kubelet
This commit is contained in:
@@ -39,12 +39,8 @@ func init() {
|
||||
*out = *in.Copy()
|
||||
return nil
|
||||
},
|
||||
// Convert ContainerManifest to BoundPod
|
||||
//
|
||||
// This function generates a dummy selfLink using the same method as the
|
||||
// boundPod registry, in order for the Kubelet to work with well-formed
|
||||
// boundPods during the integration test.
|
||||
func(in *ContainerManifest, out *BoundPod, s conversion.Scope) error {
|
||||
// Convert ContainerManifest to Pod
|
||||
func(in *ContainerManifest, out *Pod, s conversion.Scope) error {
|
||||
out.Spec.Containers = in.Containers
|
||||
out.Spec.Volumes = in.Volumes
|
||||
out.Spec.RestartPolicy = in.RestartPolicy
|
||||
@@ -53,12 +49,12 @@ func init() {
|
||||
out.UID = in.UUID
|
||||
|
||||
if in.ID != "" {
|
||||
out.SelfLink = "/api/v1beta1/boundPods/" + in.ID
|
||||
out.SelfLink = "/api/v1beta1/pods/" + in.ID
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
func(in *BoundPod, out *ContainerManifest, s conversion.Scope) error {
|
||||
func(in *Pod, out *ContainerManifest, s conversion.Scope) error {
|
||||
out.Containers = in.Spec.Containers
|
||||
out.Volumes = in.Spec.Volumes
|
||||
out.RestartPolicy = in.Spec.RestartPolicy
|
||||
@@ -70,7 +66,7 @@ func init() {
|
||||
},
|
||||
|
||||
// ContainerManifestList
|
||||
func(in *ContainerManifestList, out *BoundPods, s conversion.Scope) error {
|
||||
func(in *ContainerManifestList, out *PodList, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Items, &out.Items, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -80,7 +76,7 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
},
|
||||
func(in *BoundPods, out *ContainerManifestList, s conversion.Scope) error {
|
||||
func(in *PodList, out *ContainerManifestList, s conversion.Scope) error {
|
||||
if err := s.Convert(&in.Items, &out.Items, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ func init() {
|
||||
&ContainerManifest{},
|
||||
&ContainerManifestList{},
|
||||
&BoundPod{},
|
||||
&BoundPods{},
|
||||
&List{},
|
||||
&LimitRange{},
|
||||
&LimitRangeList{},
|
||||
@@ -79,7 +78,6 @@ func (*EventList) IsAnAPIObject() {}
|
||||
func (*ContainerManifest) IsAnAPIObject() {}
|
||||
func (*ContainerManifestList) IsAnAPIObject() {}
|
||||
func (*BoundPod) IsAnAPIObject() {}
|
||||
func (*BoundPods) IsAnAPIObject() {}
|
||||
func (*List) IsAnAPIObject() {}
|
||||
func (*LimitRange) IsAnAPIObject() {}
|
||||
func (*LimitRangeList) IsAnAPIObject() {}
|
||||
|
||||
@@ -1249,7 +1249,7 @@ type EventList struct {
|
||||
// ContainerManifest corresponds to the Container Manifest format, documented at:
|
||||
// https://developers.google.com/compute/docs/containers/container_vms#container_manifest
|
||||
// This is used as the representation of Kubernetes workloads.
|
||||
// DEPRECATED: Replaced with BoundPod
|
||||
// DEPRECATED: Replaced with Pod
|
||||
type ContainerManifest struct {
|
||||
// Required: This must be a supported version string, such as "v1beta1".
|
||||
Version string `json:"version"`
|
||||
@@ -1268,7 +1268,7 @@ type ContainerManifest struct {
|
||||
}
|
||||
|
||||
// ContainerManifestList is used to communicate container manifests to kubelet.
|
||||
// DEPRECATED: Replaced with BoundPods
|
||||
// DEPRECATED: Replaced with Pods
|
||||
type ContainerManifestList struct {
|
||||
TypeMeta `json:",inline"`
|
||||
ListMeta `json:"metadata,omitempty"`
|
||||
@@ -1279,6 +1279,8 @@ type ContainerManifestList struct {
|
||||
// BoundPod is a collection of containers that should be run on a host. A BoundPod
|
||||
// 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.
|
||||
//
|
||||
// TODO(wojtek-t): Get rid of this type.
|
||||
type BoundPod struct {
|
||||
TypeMeta `json:",inline"`
|
||||
ObjectMeta `json:"metadata,omitempty"`
|
||||
@@ -1287,19 +1289,6 @@ type BoundPod struct {
|
||||
Spec PodSpec `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// 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"`
|
||||
ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
// Host is the name of a node that these pods were bound to.
|
||||
Host string `json:"host"`
|
||||
|
||||
// Items is the list of all pods bound to a given host.
|
||||
Items []BoundPod `json:"items"`
|
||||
}
|
||||
|
||||
// List holds a list of objects, which may not be known by the server.
|
||||
type List struct {
|
||||
TypeMeta `json:",inline"`
|
||||
|
||||
@@ -1079,7 +1079,7 @@ type BoundPods struct {
|
||||
Host string `json:"host" description:"name of a node that these pods were bound to"`
|
||||
|
||||
// Items is the list of all pods bound to a given host.
|
||||
Items []BoundPod `json:"items" description:"list of all pods bound to a given host"`
|
||||
Items []Pod `json:"items" description:"list of all pods bound to a given host"`
|
||||
}
|
||||
|
||||
// List holds a list of objects, which may not be known by the server.
|
||||
|
||||
@@ -1141,7 +1141,7 @@ type BoundPods struct {
|
||||
Host string `json:"host" description:"name of a node that these pods were bound to"`
|
||||
|
||||
// Items is the list of all pods bound to a given host.
|
||||
Items []BoundPod `json:"items" description:"list of all pods bound to a given host"`
|
||||
Items []Pod `json:"items" description:"list of all pods bound to a given host"`
|
||||
}
|
||||
|
||||
// List holds a list of objects, which may not be known by the server.
|
||||
|
||||
@@ -671,7 +671,7 @@ type BoundPods struct {
|
||||
Host string `json:"host" description:"name of a node that these pods were bound to"`
|
||||
|
||||
// Items is the list of all pods bound to a given host.
|
||||
Items []BoundPod `json:"items" description:"list of all pods bound to a given host"`
|
||||
Items []Pod `json:"items" description:"list of all pods bound to a given host"`
|
||||
}
|
||||
|
||||
// ReplicationControllerSpec is the specification of a replication controller.
|
||||
|
||||
Reference in New Issue
Block a user