Skip to content

Commit

Permalink
straightforward error for missing name-like metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
julian7 committed Oct 28, 2022
1 parent beec1f8 commit af19b2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kyaml/yaml/rnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,10 @@ func (rn *RNode) GetValidatedMetadata() (ResourceMeta, error) {
return m, nil
}
if m.NameMeta.Name == "" && m.NameMeta.GenerateName == "" {
return m, fmt.Errorf("missing metadata.name in object %v", m)
return m, fmt.Errorf(
"missing metadata.name or metadata.generateName in object %v",
m,
)
}
return m, nil
}
Expand Down

0 comments on commit af19b2a

Please sign in to comment.