Skip to content

Commit

Permalink
Use a different method to retrieve YAML output in tests
Browse files Browse the repository at this point in the history
OutputToString() was mangling newlines, which made YAML parsers
very, very angry. But not angry enough to actually error, that
would be too easy. Just angry enough to silently not decode
anything.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
  • Loading branch information
mheon committed Jun 25, 2019
1 parent 6b0ff18 commit 07ebbfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/generate_kube_test.go
Expand Up @@ -136,7 +136,7 @@ var _ = Describe("Podman generate kube", func() {
fmt.Printf("POD YAML IS %s\n", kube.OutputToString())

pod := new(v1.Pod)
err := yaml.Unmarshal([]byte(kube.OutputToString()), pod)
err := yaml.Unmarshal(kube.Out.Contents(), pod)
Expect(err).To(BeNil())

fmt.Printf("# of containers in pod is %d\n", len(pod.Spec.Containers))
Expand Down

0 comments on commit 07ebbfc

Please sign in to comment.