File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/cli/src/commands/gen-models Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,15 @@ async function genModelsAction(): Promise<void> {
153153 moduleLogger . info ( "Config file exists, searching extra CRDs..." )
154154 const configFile = await fs . readFile ( "config.yaml" , "utf8" )
155155 const config = YAML . parse ( configFile )
156- // FIXME handle config.extraCrds not existing
157- const crds = await fetchExtraCRDs ( config . extraCrds )
158- for ( const crd of crds ) {
159- documents . push ( crd )
156+ if ( ! config . extraCrds ) {
157+ moduleLogger . info ( "Config file has no extra CRDs" )
158+ } else if ( ! Array . isArray ( config . extraCrds ) ) {
159+ moduleLogger . warn ( "Config file extraCrds field is not an array!" )
160+ } else {
161+ const crds = await fetchExtraCRDs ( config . extraCrds )
162+ for ( const crd of crds ) {
163+ documents . push ( crd )
164+ }
160165 }
161166 }
162167
You can’t perform that action at this time.
0 commit comments