Documentation
¶
Index ¶
- func DropInvalidFields(proxy *egv1a1.EnvoyProxy) *egv1a1.EnvoyProxy
- func ValidateClusterStatName(clusterStatName string) error
- func ValidateEnvoyGateway(eg *egv1a1.EnvoyGateway) error
- func ValidateEnvoyProxy(proxy *egv1a1.EnvoyProxy) error
- func ValidateMinContentLength(minContentLength *resource.Quantity) error
- func ValidateRedisURL(redisURL string) error
- func ValidateRouteStatName(routeStatName string) error
- type InvalidField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropInvalidFields ¶ added in v1.10.0
func DropInvalidFields(proxy *egv1a1.EnvoyProxy) *egv1a1.EnvoyProxy
DropInvalidFields returns a copy of proxy with every field reported by ValidateEnvoyProxyFields as an InvalidField unset. It returns proxy itself when there is nothing to drop.
It is intentionally separate from ValidateEnvoyProxyFields rather than a single validate-and-sanitize function: the translator validates each source EnvoyProxy to report status on it, and separately sanitizes each layer before merging it into the EnvoyProxy that reaches the IR, so a combined function would deep copy every EnvoyProxy on the status path just to throw the copy away. The cost is that both functions must cover the same fields; when adding an InvalidField check, clear the field here too. TestValidateEnvoyProxyFields asserts that nothing is reported after DropInvalidFields.
func ValidateClusterStatName ¶ added in v1.7.0
func ValidateEnvoyGateway ¶ added in v0.6.0
func ValidateEnvoyGateway(eg *egv1a1.EnvoyGateway) error
ValidateEnvoyGateway validates the provided EnvoyGateway.
func ValidateEnvoyProxy ¶ added in v0.6.0
func ValidateEnvoyProxy(proxy *egv1a1.EnvoyProxy) error
ValidateEnvoyProxy validates the provided EnvoyProxy.
func ValidateMinContentLength ¶ added in v1.10.0
ValidateMinContentLength validates that the compression minContentLength fits the uint32 Envoy field.
func ValidateRedisURL ¶ added in v1.9.0
ValidateRedisURL validates a ratelimit Redis URL string, which may be a single host or a comma-delimited list of hosts for Sentinel and Cluster deployments.
func ValidateRouteStatName ¶ added in v1.7.0
Types ¶
type InvalidField ¶ added in v1.10.0
type InvalidField struct {
// Path is the path of the field relative to the EnvoyProxy spec.
Path string
Err error
}
InvalidField is an EnvoyProxy field that failed validation but can be unset without affecting the proxy infrastructure or the rest of the EnvoyProxy configuration.
func ValidateEnvoyProxyFields ¶ added in v1.10.0
func ValidateEnvoyProxyFields(proxy *egv1a1.EnvoyProxy) ([]InvalidField, error)
ValidateEnvoyProxyFields validates the provided EnvoyProxy like ValidateEnvoyProxy, but returns the errors scoped to a field that DropInvalidFields can unset separately from the errors that make the whole EnvoyProxy unusable.
func (InvalidField) Error ¶ added in v1.10.0
func (f InvalidField) Error() string