Skip to content

Commit e2519d9

Browse files
authored
[api] schema: extendedOptions as untyped object (#327)
`extendedOptions` are used to store unstructured metadata. This PR ensures the OpenAPI schema reflects that.
1 parent 0484dcc commit e2519d9

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

bundle.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,14 +3382,8 @@ spec:
33823382
options.
33833383
properties:
33843384
options:
3385-
additionalProperties:
3386-
description: RawMessage is a raw encoded JSON value.
3387-
It implements Marshaler and Unmarshaler and can
3388-
be used to delay JSON decoding or precompute a JSON
3389-
encoding.
3390-
format: byte
3391-
type: string
33923385
type: object
3386+
x-kubernetes-preserve-unknown-fields: true
33933387
type:
33943388
type: string
33953389
type: object

helm/m3db-operator/templates/00_operator.m3db.io_m3dbclusters.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,14 +3374,8 @@ spec:
33743374
options.
33753375
properties:
33763376
options:
3377-
additionalProperties:
3378-
description: RawMessage is a raw encoded JSON value.
3379-
It implements Marshaler and Unmarshaler and can
3380-
be used to delay JSON decoding or precompute a JSON
3381-
encoding.
3382-
format: byte
3383-
type: string
33843377
type: object
3378+
x-kubernetes-preserve-unknown-fields: true
33853379
type:
33863380
type: string
33873381
type: object

pkg/apis/m3dboperator/v1alpha1/namespace.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ type DownsampleOptions struct {
102102

103103
// ExtendedOptions stores the extended namespace options.
104104
type ExtendedOptions struct {
105-
Type string `json:"type,omitempty"`
105+
Type string `json:"type,omitempty"`
106+
// +kubebuilder:pruning:PreserveUnknownFields
107+
// +kubebuilder:validation:Schemaless
108+
// +kubebuilder:validation:Type=object
106109
Options map[string]json.RawMessage `json:"options,omitempty"`
107110
}
108111

0 commit comments

Comments
 (0)