(tc *testutils.TestContext, version string, csv *v1alpha1.ClusterServiceVersion, isBundle bool)
| 179 | } |
| 180 | |
| 181 | func writeCSV(tc *testutils.TestContext, version string, csv *v1alpha1.ClusterServiceVersion, isBundle bool) error { |
| 182 | b, err := yaml.Marshal(csv) |
| 183 | if err != nil { |
| 184 | return err |
| 185 | } |
| 186 | f, err := os.OpenFile(csvPath(tc, version, isBundle), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666) |
| 187 | if err != nil { |
| 188 | return err |
| 189 | } |
| 190 | if _, err := f.Write(b); err != nil { |
| 191 | return err |
| 192 | } |
| 193 | if err := f.Sync(); err != nil { |
| 194 | return err |
| 195 | } |
| 196 | return f.Close() |
| 197 | } |
| 198 | |
| 199 | func csvPath(tc *testutils.TestContext, version string, isBundle bool) string { |
| 200 | fileName := fmt.Sprintf("%s.clusterserviceversion.yaml", tc.ProjectName) |
no test coverage detected