From ca935558d33b992cf74a9a1e5d5be4b52a95a8ad Mon Sep 17 00:00:00 2001 From: Matt Schallert Date: Tue, 12 Jul 2022 02:14:31 +0000 Subject: [PATCH] [api] schema: extendedOptions as untyped object `extendedOptions` are used to store unstructured metadata. This PR ensures the OpenAPI schema reflects that. --- bundle.yaml | 8 +------- .../templates/00_operator.m3db.io_m3dbclusters.yaml | 8 +------- pkg/apis/m3dboperator/v1alpha1/namespace.go | 5 ++++- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/bundle.yaml b/bundle.yaml index fff5bc8..9f8fc29 100644 --- a/bundle.yaml +++ b/bundle.yaml @@ -3382,14 +3382,8 @@ spec: options. properties: options: - additionalProperties: - description: RawMessage is a raw encoded JSON value. - It implements Marshaler and Unmarshaler and can - be used to delay JSON decoding or precompute a JSON - encoding. - format: byte - type: string type: object + x-kubernetes-preserve-unknown-fields: true type: type: string type: object diff --git a/helm/m3db-operator/templates/00_operator.m3db.io_m3dbclusters.yaml b/helm/m3db-operator/templates/00_operator.m3db.io_m3dbclusters.yaml index 320bfb8..0bd4d41 100644 --- a/helm/m3db-operator/templates/00_operator.m3db.io_m3dbclusters.yaml +++ b/helm/m3db-operator/templates/00_operator.m3db.io_m3dbclusters.yaml @@ -3374,14 +3374,8 @@ spec: options. properties: options: - additionalProperties: - description: RawMessage is a raw encoded JSON value. - It implements Marshaler and Unmarshaler and can - be used to delay JSON decoding or precompute a JSON - encoding. - format: byte - type: string type: object + x-kubernetes-preserve-unknown-fields: true type: type: string type: object diff --git a/pkg/apis/m3dboperator/v1alpha1/namespace.go b/pkg/apis/m3dboperator/v1alpha1/namespace.go index 784480f..d71fa17 100644 --- a/pkg/apis/m3dboperator/v1alpha1/namespace.go +++ b/pkg/apis/m3dboperator/v1alpha1/namespace.go @@ -102,7 +102,10 @@ type DownsampleOptions struct { // ExtendedOptions stores the extended namespace options. type ExtendedOptions struct { - Type string `json:"type,omitempty"` + Type string `json:"type,omitempty"` + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + // +kubebuilder:validation:Type=object Options map[string]json.RawMessage `json:"options,omitempty"` }