File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,19 @@ func gatewayTweaks(channel string, props map[string]apiext.JSONSchemaProps) map[
222222 jsonProps .Description = strings .ReplaceAll (jsonProps .Description , endTag , "" )
223223 }
224224
225+ startTag = "<gateway:util:excludeFromCRD>"
226+ endTag = "</gateway:util:excludeFromCRD>"
227+ regexPattern = `(?:\r?\n)*` + regexp .QuoteMeta (startTag ) + `(?s:(.*?))` + regexp .QuoteMeta (endTag ) + `(?:\r?\n)*`
228+ if strings .Contains (jsonProps .Description , "<gateway:util:excludeFromCRD>" ) {
229+ re := regexp .MustCompile (regexPattern )
230+ match := re .FindStringSubmatch (jsonProps .Description )
231+ if len (match ) != 2 {
232+ log .Fatalf ("Invalid <gateway:util:excludeFromCRD> tag for %s" , name )
233+ }
234+ modifiedDescription := re .ReplaceAllString (jsonProps .Description , "\n \n " )
235+ jsonProps .Description = modifiedDescription
236+ }
237+
225238 if numValid < numExpressions {
226239 fmt .Printf ("Description: %s\n " , jsonProps .Description )
227240 log .Fatalf ("Found %d Gateway validation expressions, but only %d were valid" , numExpressions , numValid )
You can’t perform that action at this time.
0 commit comments