testWriteRandomObjects randomly generates Kubernetes objects and writes them in the specified path. The created objects are returned with Type information clean. If object count is < 0, a random number will be used.
(t *testing.T, dir string, count int)
| 107 | // testWriteRandomObjects randomly generates Kubernetes objects and writes them in the specified path. |
| 108 | // The created objects are returned with Type information clean. If object count is < 0, a random number will be used. |
| 109 | func testWriteRandomObjects(t *testing.T, dir string, count int) []deploy.KubeObject { |
| 110 | objects := testRandomObjects(count) |
| 111 | |
| 112 | kubeDir := path.Join(dir, ObjectsDir) |
| 113 | err := os.Mkdir(kubeDir, TestFilePerms) |
| 114 | if err != nil { |
| 115 | t.Fatal(err) |
| 116 | } |
| 117 | |
| 118 | for _, obj := range objects { |
| 119 | filename := path.Join(kubeDir, obj.GetObjectMeta().GetName()+".yml") |
| 120 | testWriteYAMLToFile(t, filename, obj) |
| 121 | |
| 122 | // cleanup type information which is removed from decoded objects |
| 123 | testClearTypeInfo(obj) |
| 124 | } |
| 125 | |
| 126 | return objects |
| 127 | } |
| 128 | |
| 129 | func testKubePod() *kube.Pod { |
| 130 | terminationPeriod := int64(30) |
no test coverage detected