Skip to content

Commit

Permalink
Add jobGenerateName test
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyserious committed Jan 13, 2023
1 parent 8165fda commit 74bb78d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion kyaml/yaml/rnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 74bb78d

Please sign in to comment.