From 74bb78d58b393d603794ea4309daea3ad60cb834 Mon Sep 17 00:00:00 2001 From: Anthony Schneider Date: Fri, 13 Jan 2023 09:59:02 -0500 Subject: [PATCH] Add jobGenerateName test --- kyaml/yaml/rnode_test.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/kyaml/yaml/rnode_test.go b/kyaml/yaml/rnode_test.go index 506ccba9c9..f9688b25ad 100644 --- a/kyaml/yaml/rnode_test.go +++ b/kyaml/yaml/rnode_test.go @@ -403,7 +403,7 @@ func TestRNodeGetValidatedMetadata(t *testing.T) { "kind": "ConfigMap", }, rsExp: resultExpected{ - errMsg: "missing metadata.name", + errMsg: "missing metadata.name and metadata.generateName", }, }, "configmap": { @@ -458,6 +458,28 @@ func TestRNodeGetValidatedMetadata(t *testing.T) { }, }, }, + "jobGenerateName": { + theMap: map[string]interface{}{ + "apiVersion": "batch/v1", + "kind": "Job", + "metadata": map[string]interface{}{ + "generateName": "winnie-", + }, + }, + rsExp: resultExpected{ + out: ResourceMeta{ + TypeMeta: TypeMeta{ + APIVersion: "batch/v1", + Kind: "Job", + }, + ObjectMeta: ObjectMeta{ + NameMeta: NameMeta{ + GenerateName: "winnie-", + }, + }, + }, + }, + }, } for n := range testCases {