Skip to content

Commit eb3d796

Browse files
authored
Merge pull request #1146 from Adirio/validate_resource
Remove duplicated scaffold API validation code
2 parents ae06fc8 + a024127 commit eb3d796

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/scaffold/api.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ func (api *API) Validate() error {
5757
if err := api.setDefaults(); err != nil {
5858
return err
5959
}
60-
if api.Resource.Group == "" {
61-
return fmt.Errorf("missing group information for resource")
62-
}
63-
if api.Resource.Version == "" {
64-
return fmt.Errorf("missing version information for resource")
65-
}
66-
if api.Resource.Kind == "" {
67-
return fmt.Errorf("missing kind information for resource")
60+
if err := api.Resource.Validate(); err != nil {
61+
return err
6862
}
6963

7064
return nil

0 commit comments

Comments
 (0)