From 83322bd9282023149e7012325dc3664a03c0f3d1 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Tue, 28 May 2019 12:17:53 +0200 Subject: [PATCH] apiextensions: document that webhook conversion requires preserveUnknownFields=false --- .../apiextensions-apiserver/pkg/apis/apiextensions/types.go | 3 ++- .../pkg/apis/apiextensions/v1beta1/types.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go index 8daa1f960ff..9c2798f0307 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go @@ -85,7 +85,8 @@ type CustomResourceDefinitionSpec struct { type CustomResourceConversion struct { // `strategy` specifies the conversion strategy. Allowed values are: // - `None`: The converter only change the apiVersion and would not touch any other field in the CR. - // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information is needed for this option. + // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information + // is needed for this option. This requires spec.preserveUnknownFields to be false. Strategy ConversionStrategyType // `webhookClientConfig` is the instructions for how to call the webhook if strategy is `Webhook`. diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go index 63e25245d82..6d931ca95c1 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go @@ -90,7 +90,8 @@ type CustomResourceDefinitionSpec struct { type CustomResourceConversion struct { // `strategy` specifies the conversion strategy. Allowed values are: // - `None`: The converter only change the apiVersion and would not touch any other field in the CR. - // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information is needed for this option. + // - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information + // is needed for this option. This requires spec.preserveUnknownFields to be false. Strategy ConversionStrategyType `json:"strategy" protobuf:"bytes,1,name=strategy"` // `webhookClientConfig` is the instructions for how to call the webhook if strategy is `Webhook`. This field is