Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions config/servicemappings/compute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,42 @@ spec:
version: v1beta1
group: compute.cnrm.cloud.google.com
targetField: self_link
- tfField: default_custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.default_custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.path_rule.custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.route_rules.custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: default_route_action.request_mirror_policy.backend_service
key: backendServiceRef
description: |-
Expand Down Expand Up @@ -2736,6 +2772,42 @@ spec:
version: v1beta1
group: compute.cnrm.cloud.google.com
targetField: self_link
- tfField: default_custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.default_custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.path_rule.custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: path_matcher.route_rules.custom_error_response_policy.error_service
key: errorServiceRef
description: |-
The full or partial URL to the BackendBucket resource that contains the custom error content.
gvk:
group: compute.cnrm.cloud.google.com
version: v1beta1
kind: ComputeBackendBucket
targetField: self_link
- tfField: default_route_action.request_mirror_policy.backend_service
key: backendServiceRef
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-${uniqueId}
spec:
location: global
defaultService:
backendBucketRef:
name: computebackendbucket-${uniqueId}
defaultCustomErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "4xx"
- "5xx"
overrideResponseCode: 404
path: /error.html
pathMatcher:
- name: "allpaths"
defaultService:
backendBucketRef:
name: computebackendbucket-${uniqueId}
defaultCustomErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "401"
overrideResponseCode: 403
path: /401.html
pathRule:
- paths:
- "/api/*"
service:
backendBucketRef:
name: computebackendbucket-${uniqueId}
customErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "500"
path: /500.html
hostRule:
- hosts:
- "mysite.com"
pathMatcher: "allpaths"
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeBackendBucket
metadata:
name: computebackendbucket-${uniqueId}
spec:
bucketRef:
name: storagebucket-${uniqueId}
description: A ComputeBackendBucket for testing CustomErrorResponsePolicy
---
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageBucket
metadata:
name: storagebucket-${uniqueId}
spec:
location: US
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeURLMap
metadata:
name: computeurlmap-${uniqueId}
spec:
location: global
defaultService:
backendBucketRef:
name: computebackendbucket-${uniqueId}
defaultCustomErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "4xx"
- "5xx"
overrideResponseCode: 404
path: /error.html
pathMatcher:
- name: "allpaths"
defaultService:
backendBucketRef:
name: computebackendbucket-${uniqueId}
defaultCustomErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "401"
overrideResponseCode: 403
path: /401.html
pathRule:
- paths:
- "/api/*"
service:
backendBucketRef:
name: computebackendbucket-${uniqueId}
customErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "500"
path: /500.html
overrideResponseCode: 502
routeRules:
- priority: 1
matchRules:
- prefixMatch: "/blog"
service:
backendBucketRef:
name: computebackendbucket-${uniqueId}
customErrorResponsePolicy:
errorServiceRef:
name: computebackendbucket-${uniqueId}
errorResponseRules:
- matchResponseCodes:
- "4xx"
path: /error4xx.html
overrideResponseCode: 404
hostRule:
- hosts:
- "mysite.com"
pathMatcher: "allpaths"
description: Updated description
3 changes: 0 additions & 3 deletions tests/apichecks/testdata/exceptions/missingfields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,6 @@
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultRouteAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultRouteAction.weightedBackendServices[].weight" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultService.backendBucketRef" is not set; neither 'external' nor 'name' are set
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultUrlRedirect.hostRedirect" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultUrlRedirect.httpsRedirect" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.defaultUrlRedirect.pathRedirect" is not set in unstructured objects
Expand Down Expand Up @@ -1091,7 +1090,6 @@
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].headerAction.responseHeadersToRemove[]" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].routeAction.corsPolicy.allowOriginRegexes[]" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].routeAction.retryPolicy.perTryTimeout.nanos" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].service.backendBucketRef" is not set; neither 'external' nor 'name' are set
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].service.backendServiceRef" is not set; neither 'external' nor 'name' are set
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].urlRedirect.hostRedirect" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].pathRule[].urlRedirect.httpsRedirect" is not set in unstructured objects
Expand Down Expand Up @@ -1158,7 +1156,6 @@
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].headerValue" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToAdd[].replace" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].routeAction.weightedBackendServices[].headerAction.responseHeadersToRemove[]" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].service" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].urlRedirect.hostRedirect" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].urlRedirect.httpsRedirect" is not set in unstructured objects
[missing_field] crd=computeurlmaps.compute.cnrm.cloud.google.com version=v1beta1: field ".spec.pathMatcher[].routeRules[].urlRedirect.pathRedirect" is not set in unstructured objects
Expand Down
Loading
Loading