INNER CODE UNIT · Go
gatewayTweaksMap
kubernetes-sigs/gateway-api · tools/generator/main.go:271
func gatewayTweaksMap(channel string, props map[string]apiext.JSONSchemaProps) map[string]apiext.JSONSchemaProps {
for name := range props {
jsonProps := props[name]
p := gatewayTweaks(channel, name, jsonProps)
if p == nil {
delete(props, name)
} else {
props[name] = *p
}
}
return props
}
// Custom Gateway API Tweaks for tags prefixed with `<gateway:` that get past
// the limitations of Kubebuilder annotations.
func gatewayTweaks(channel string, name string, jsonProps apiext.JSONSchemaProps) *apiext.JSONSchemaProps {
if strings.Contains(jsonProps.Description, "<gateway:validateIPAddress>") {
jsonProps.Items.Schema.OneOf = []apiext.JSONSchemaProps{{