MCPcopy
hub / github.com/redspread/spread / testNewKubeRC

Function testNewKubeRC

pkg/entity/replicationcontroller_test.go:343–361  ·  view source on GitHub ↗
(meta kube.ObjectMeta, selector map[string]string, pod *kube.Pod)

Source from the content-addressed store, hash-verified

341}
342
343func testNewKubeRC(meta kube.ObjectMeta, selector map[string]string, pod *kube.Pod) *kube.ReplicationController {
344 var spec *kube.PodTemplateSpec
345 if pod != nil {
346 meta := pod.ObjectMeta
347 meta.Namespace = kube.NamespaceDefault
348 meta.Name = ""
349 spec = &kube.PodTemplateSpec{
350 ObjectMeta: meta,
351 Spec: pod.Spec,
352 }
353 }
354 return &kube.ReplicationController{
355 ObjectMeta: meta,
356 Spec: kube.ReplicationControllerSpec{
357 Selector: selector,
358 Template: spec,
359 },
360 }
361}
362
363func testNewRC(t *testing.T, name string, selector map[string]string, objects []deploy.KubeObject) *ReplicationController {
364 rcMeta := kube.ObjectMeta{Name: name}

Callers 5

TestRCInvalidPodFunction · 0.85
TestRCValidPodImagesFunction · 0.85
TestRCValidPodDeploymentFunction · 0.85
TestRCBadObjectsFunction · 0.85
testNewRCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected