From c68cf40d75ce4430fbbbc72296ca3bf458873e15 Mon Sep 17 00:00:00 2001 From: monopole Date: Wed, 13 Jan 2021 10:26:12 -0800 Subject: [PATCH] Add a test that only loads an annotated resource. --- api/krusty/basic_io_test.go | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 api/krusty/basic_io_test.go diff --git a/api/krusty/basic_io_test.go b/api/krusty/basic_io_test.go new file mode 100644 index 000000000..82a38e8fc --- /dev/null +++ b/api/krusty/basic_io_test.go @@ -0,0 +1,44 @@ +// Copyright 2020 The Kubernetes Authors. +// SPDX-License-Identifier: Apache-2.0 + +package krusty_test + +import ( + "testing" + + kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest" +) + +func TestBasicIO1(t *testing.T) { + th := kusttest_test.MakeHarness(t) + th.WriteK(".", ` +resources: +- service.yaml +`) + th.WriteF("service.yaml", ` +apiVersion: v1 +kind: Service +metadata: + annotations: + port: 8080 + happy: true + color: green + name: demo +spec: + clusterIP: None +`) + m := th.Run(".", th.MakeDefaultOptions()) + th.AssertActualEqualsExpected( + m, ` +apiVersion: v1 +kind: Service +metadata: + annotations: + color: green + happy: true + port: 8080 + name: demo +spec: + clusterIP: None +`) +}