Documentation
¶
Index ¶
- func GetSimpleErrorFromGlooValidation(reports []*gloovalidation.GlooValidationReport, proxy *gloov1.Proxy) error
- func GetSimpleErrorFromGlooValidationForUpstream(reports []*gloovalidation.GlooValidationReport, upstream *gloov1.Upstream) error
- func TranslateK8sGatewayProxies(ctx context.Context, snap *gloosnapshot.ApiSnapshot, res resources.Resource) ([]*gloov1.Proxy, error)
- func TranslateK8sGatewayProxiesForUpstream(ctx context.Context, snap *gloosnapshot.ApiSnapshot, upstream *gloov1.Upstream) ([]*gloov1.Proxy, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSimpleErrorFromGlooValidation ¶
func GetSimpleErrorFromGlooValidation( reports []*gloovalidation.GlooValidationReport, proxy *gloov1.Proxy, ) error
GetSimpleErrorFromGlooValidation will get the Errors for the provided `proxy` that exist in the provided `reports` This function will return with the first error present if multiple reports exist
func GetSimpleErrorFromGlooValidationForUpstream ¶ added in v1.22.0
func GetSimpleErrorFromGlooValidationForUpstream( reports []*gloovalidation.GlooValidationReport, upstream *gloov1.Upstream, ) error
GetSimpleErrorFromGlooValidationForUpstream returns the errors reported against the given `upstream` in the provided `reports`. Unlike route and virtual host errors, ProcessUpstream errors such as an invalid grpcjson protoDescriptorBin are attributed to the Upstream resource rather than the proxy, so they are looked up by the Upstream's kind and ref. The pre-sanitization reports are read because the xDS sanitizers demote Upstream errors to warnings before the final reports are produced. The first error found is returned if multiple reports exist.
func TranslateK8sGatewayProxies ¶
func TranslateK8sGatewayProxies(ctx context.Context, snap *gloosnapshot.ApiSnapshot, res resources.Resource) ([]*gloov1.Proxy, error)
TranslateK8sGatewayProxies builds an extremely basic "dummy" gloov1.Proxy object with the provided `res` attached in the correct location, i.e. if a RouteOption is passed it will be on the Route or if a VirtualHostOption is passed it will be on the VirtualHost
func TranslateK8sGatewayProxiesForUpstream ¶ added in v1.22.0
func TranslateK8sGatewayProxiesForUpstream(ctx context.Context, snap *gloosnapshot.ApiSnapshot, upstream *gloov1.Upstream) ([]*gloov1.Proxy, error)
TranslateK8sGatewayProxiesForUpstream builds the same "dummy" gloov1.Proxy as TranslateK8sGatewayProxies, but routes to the given `upstream` instead of the fake one. This is how an Upstream is validated in K8s Gateway API mode, where the Upstream is otherwise never translated because HTTPRoutes are not in the ApiSnapshot. The real Upstream must be the route destination because the plugin chain (for example the grpcjson plugin's ProcessUpstream) only runs for Upstreams referenced by a route in the proxy. ValidateGloo adds the Upstream to the snapshot before translation, so the reference resolves.
Types ¶
This section is empty.