Skip to content

Commit

Permalink
added a comment for excludeFromCRD tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Devaansh-Kumar committed Sep 9, 2024
1 parent 48caedd commit de71b43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func gatewayTweaks(channel string, props map[string]apiext.JSONSchemaProps) map[
jsonProps.Description = strings.ReplaceAll(jsonProps.Description, endTag, "")
}

// Comments within "gateway:util:excludeFromCRD" tag is not included in the generated CRD and all trailing \n operators before
// and after the tags are removed and replaced with three \n operators.
startTag = "<gateway:util:excludeFromCRD>"
endTag = "</gateway:util:excludeFromCRD>"
regexPattern = `\n*` + regexp.QuoteMeta(startTag) + `(?s:(.*?))` + regexp.QuoteMeta(endTag) + `\n*`
Expand Down

0 comments on commit de71b43

Please sign in to comment.