From bbac87e94f8baaeaf6ad837299710655af38cabd Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Tue, 20 Apr 2021 15:40:27 -0600 Subject: [PATCH 1/2] Allow unstructured schema for the ProxyDefaults CRD --- api/v1alpha1/proxydefaults_types.go | 1 + config/crd/bases/consul.hashicorp.com_proxydefaults.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/api/v1alpha1/proxydefaults_types.go b/api/v1alpha1/proxydefaults_types.go index fcfc15d0bd..2214712290 100644 --- a/api/v1alpha1/proxydefaults_types.go +++ b/api/v1alpha1/proxydefaults_types.go @@ -56,6 +56,7 @@ type ProxyDefaultsSpec struct { // Supports JSON config values. See https://www.consul.io/docs/connect/proxies/envoy#configuration-formatting // +kubebuilder:validation:Type=object // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields Config json.RawMessage `json:"config,omitempty"` // MeshGateway controls the default mesh gateway configuration for this service. MeshGateway MeshGatewayConfig `json:"meshGateway,omitempty"` diff --git a/config/crd/bases/consul.hashicorp.com_proxydefaults.yaml b/config/crd/bases/consul.hashicorp.com_proxydefaults.yaml index a78d802a23..1748a74eb0 100644 --- a/config/crd/bases/consul.hashicorp.com_proxydefaults.yaml +++ b/config/crd/bases/consul.hashicorp.com_proxydefaults.yaml @@ -48,6 +48,7 @@ spec: config: description: Config is an arbitrary map of configuration values used by Connect proxies. Any values that your proxy allows can be configured globally here. Supports JSON config values. See https://www.consul.io/docs/connect/proxies/envoy#configuration-formatting type: object + x-kubernetes-preserve-unknown-fields: true expose: description: Expose controls the default expose path configuration for Envoy. properties: From db71c500fd39010450a2937e3f2bb410672fc212 Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Tue, 20 Apr 2021 15:54:37 -0600 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db75e63704..14e6542a29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## UNRELEASED +BUG FIXES: +* CRDs: Fix a bug where the `config` field in `ProxyDefaults` CR was not synced to Consul because + `apiextensions.k8s.io/v1` requires CRD spec to have structured schema. [[GH-495](https://github.com/hashicorp/consul-k8s/pull/495)] + ## 0.26.0-beta1 (April 16, 2021) BREAKING CHANGES: