@@ -51,31 +51,35 @@ func (c *converter) convert(storage *storage) (i2gw.GatewayResources, field.Erro
5151 ingressList = append (ingressList , * ingress )
5252 }
5353
54- globalErrs := field.ErrorList {}
54+ errorList := field.ErrorList {}
5555
5656 // Convert plain ingress resources to gateway resources, ignoring all
5757 // provider-specific features.
5858 gatewayResources , errs := common .ToGateway (ingressList , c .implementationSpecificOptions )
5959 if len (errs ) > 0 {
60- globalErrs = append (globalErrs , errs ... )
60+ errorList = append (errorList , errs ... )
6161 }
6262
6363 tcpGatewayResources , errs := crds .TCPIngressToGatewayAPI (storage .TCPIngresses )
6464 if len (errs ) > 0 {
65- globalErrs = append (globalErrs , errs ... )
65+ errorList = append (errorList , errs ... )
66+ }
67+
68+ if len (errorList ) > 0 {
69+ return i2gw.GatewayResources {}, errorList
6670 }
6771
6872 gatewayResources , errs = i2gw .MergeGatewayResources (gatewayResources , tcpGatewayResources )
6973 if len (errs ) > 0 {
70- globalErrs = append ( globalErrs , errs ... )
74+ return i2gw. GatewayResources {} , errs
7175 }
7276
7377 for _ , parseFeatureFunc := range c .featureParsers {
7478 // Apply the feature parsing function to the gateway resources, one by one.
7579 errs = parseFeatureFunc (i2gw.InputResources {Ingresses : ingressList }, & gatewayResources )
7680 // Append the parsing errors to the error list.
77- globalErrs = append (globalErrs , errs ... )
81+ errorList = append (errorList , errs ... )
7882 }
7983
80- return gatewayResources , globalErrs
84+ return gatewayResources , errorList
8185}
0 commit comments