...
1# Copyright 2022 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# This kustomization.yaml is not intended to be run by itself.
16# It will be copied by the `manifests` Makefile target
17# and the copied file will be edited to add CRDs as resources dynamically.
18
19# The patch is to specifically set spec.preserveUnknownFields: false
20# for compatibility with apiextensions.k8s.io/v1 CRDs. See more details
21# here: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning
22# The reason that we have to use kustomize to patch this change is because
23# go-yaml library will marshal CRD structs to bytes with spec.preserveUnknownFields field omitted
24# because it has the golang default value `false` for bool type.
25patches:
26- patch: |-
27 - op: add
28 path: /spec/preserveUnknownFields
29 value: false
30 target:
31 group: apiextensions.k8s.io
32 version: v1
33 kind: CustomResourceDefinition
34 name: ".*"
View as plain text