mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 20:57:20 +00:00
Remove BoundPod structure
This commit is contained in:
@@ -51,48 +51,6 @@ func TestSetDefaultService(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetDefaulPodSpec(t *testing.T) {
|
||||
bp := ¤t.BoundPod{}
|
||||
bp.Spec.Volumes = []current.Volume{{}}
|
||||
|
||||
obj2 := roundTrip(t, runtime.Object(bp))
|
||||
bp2 := obj2.(*current.BoundPod)
|
||||
if bp2.Spec.DNSPolicy != current.DNSClusterFirst {
|
||||
t.Errorf("Expected default dns policy :%s, got: %s", current.DNSClusterFirst, bp2.Spec.DNSPolicy)
|
||||
}
|
||||
policy := bp2.Spec.RestartPolicy
|
||||
if policy.Never != nil || policy.OnFailure != nil || policy.Always == nil {
|
||||
t.Errorf("Expected only policy.Always is set, got: %s", policy)
|
||||
}
|
||||
vsource := bp2.Spec.Volumes[0].Source
|
||||
if vsource.EmptyDir == nil {
|
||||
t.Errorf("Expected non-empty volume is set, got: %s", vsource.EmptyDir)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetDefaultContainer(t *testing.T) {
|
||||
bp := ¤t.BoundPod{}
|
||||
bp.Spec.Containers = []current.Container{{}}
|
||||
bp.Spec.Containers[0].Ports = []current.ContainerPort{{}}
|
||||
|
||||
obj2 := roundTrip(t, runtime.Object(bp))
|
||||
bp2 := obj2.(*current.BoundPod)
|
||||
|
||||
container := bp2.Spec.Containers[0]
|
||||
if container.TerminationMessagePath != current.TerminationMessagePathDefault {
|
||||
t.Errorf("Expected termination message path: %s, got: %s",
|
||||
current.TerminationMessagePathDefault, container.TerminationMessagePath)
|
||||
}
|
||||
if container.ImagePullPolicy != current.PullIfNotPresent {
|
||||
t.Errorf("Expected image pull policy: %s, got: %s",
|
||||
current.PullIfNotPresent, container.ImagePullPolicy)
|
||||
}
|
||||
if container.Ports[0].Protocol != current.ProtocolTCP {
|
||||
t.Errorf("Expected protocol: %s, got: %s",
|
||||
current.ProtocolTCP, container.Ports[0].Protocol)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetDefaultSecret(t *testing.T) {
|
||||
s := ¤t.Secret{}
|
||||
obj2 := roundTrip(t, runtime.Object(s))
|
||||
|
@@ -50,8 +50,6 @@ func init() {
|
||||
&EventList{},
|
||||
&ContainerManifest{},
|
||||
&ContainerManifestList{},
|
||||
&BoundPod{},
|
||||
&BoundPods{},
|
||||
&List{},
|
||||
&LimitRange{},
|
||||
&LimitRangeList{},
|
||||
@@ -85,8 +83,6 @@ func (*Event) IsAnAPIObject() {}
|
||||
func (*EventList) IsAnAPIObject() {}
|
||||
func (*ContainerManifest) IsAnAPIObject() {}
|
||||
func (*ContainerManifestList) IsAnAPIObject() {}
|
||||
func (*BoundPod) IsAnAPIObject() {}
|
||||
func (*BoundPods) IsAnAPIObject() {}
|
||||
func (*List) IsAnAPIObject() {}
|
||||
func (*LimitRange) IsAnAPIObject() {}
|
||||
func (*LimitRangeList) IsAnAPIObject() {}
|
||||
|
@@ -1065,7 +1065,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" description:"manifest version; must be v1beta1"`
|
||||
@@ -1084,7 +1084,7 @@ type ContainerManifest struct {
|
||||
}
|
||||
|
||||
// ContainerManifestList is used to communicate container manifests to kubelet.
|
||||
// DEPRECATED: Replaced with BoundPods
|
||||
// DEPRECATED: Replaced with PodList
|
||||
type ContainerManifestList struct {
|
||||
TypeMeta `json:",inline"`
|
||||
Items []ContainerManifest `json:"items" description:"list of pod container manifests"`
|
||||
@@ -1122,28 +1122,6 @@ type PodSpec struct {
|
||||
Host string `json:"host,omitempty" description:"host requested for this pod"`
|
||||
}
|
||||
|
||||
// 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.
|
||||
type BoundPod struct {
|
||||
TypeMeta `json:",inline"`
|
||||
|
||||
// Spec defines the behavior of a pod.
|
||||
Spec PodSpec `json:"spec,omitempty" description:"specification of the desired state of containers and volumes comprising the pod"`
|
||||
}
|
||||
|
||||
// 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"`
|
||||
|
||||
// Host is the name of a node that these pods were bound to.
|
||||
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 []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.
|
||||
type List struct {
|
||||
TypeMeta `json:",inline"`
|
||||
|
Reference in New Issue
Block a user