mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Add a placeholder to boundPod's SelfLink, and test that one can make references to them.
This commit is contained in:
@@ -43,5 +43,9 @@ func (b *BasicBoundPodFactory) MakeBoundPod(machine string, pod *api.Pod) (*api.
|
||||
for ix, container := range boundPod.Spec.Containers {
|
||||
boundPod.Spec.Containers[ix].Env = append(container.Env, envVars...)
|
||||
}
|
||||
// Make a dummy self link so that references to this bound pod will work.
|
||||
// TODO: When kubelets get boundPods from apiserver instead of etcd, then
|
||||
// the selflink should be generated there.
|
||||
boundPod.SelfLink = "/api/v1beta1/boundPods/" + boundPod.Name
|
||||
return boundPod, nil
|
||||
}
|
||||
|
@@ -54,6 +54,10 @@ func TestMakeBoundPodNoServices(t *testing.T) {
|
||||
if pod.Name != "foobar" {
|
||||
t.Errorf("Failed to assign ID to pod: %#v", pod.Name)
|
||||
}
|
||||
|
||||
if _, err := api.GetReference(pod); err != nil {
|
||||
t.Errorf("Unable to get a reference to bound pod: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMakeBoundPodServices(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user