From ff1b7724716cb392d16a74daae72be108f021d42 Mon Sep 17 00:00:00 2001 From: Mike Beaumont Date: Wed, 25 Sep 2024 10:40:22 +0200 Subject: [PATCH] fix(MeshTrace): invalid sampling default values (#11548) Signed-off-by: Mike Beaumont --- .../install-control-plane.defaults.golden.yaml | 10 +++++----- .../install-control-plane.gateway-api-present.yaml | 10 +++++----- .../install-control-plane.with-helm-set.yaml | 10 +++++----- .../install/testdata/install-crds.all.golden.yaml | 10 +++++----- .../charts/kuma/crds/kuma.io_meshtraces.yaml | 10 +++++----- docs/generated/openapi.yaml | 14 +++++++------- docs/generated/raw/crds/kuma.io_meshtraces.yaml | 10 +++++----- .../policies/meshtrace/api/v1alpha1/meshtrace.go | 10 +++++----- .../policies/meshtrace/api/v1alpha1/schema.yaml | 10 +++++----- .../meshtrace/k8s/crd/kuma.io_meshtraces.yaml | 10 +++++----- 10 files changed, 52 insertions(+), 52 deletions(-) diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml index 141dad6f99bd..6889e34a1615 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.defaults.golden.yaml @@ -6409,7 +6409,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -6420,13 +6420,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -6436,7 +6436,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml index 46361bb3aea8..c62d3ebb0ce0 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.gateway-api-present.yaml @@ -6409,7 +6409,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -6420,13 +6420,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -6436,7 +6436,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml index f767b1779d6b..fdde252faf77 100644 --- a/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml +++ b/app/kumactl/cmd/install/testdata/install-control-plane.with-helm-set.yaml @@ -6429,7 +6429,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -6440,13 +6440,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -6456,7 +6456,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml index 85a5590b5441..d43ca75143a1 100644 --- a/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml +++ b/app/kumactl/cmd/install/testdata/install-crds.all.golden.yaml @@ -7956,7 +7956,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -7967,13 +7967,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -7983,7 +7983,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/deployments/charts/kuma/crds/kuma.io_meshtraces.yaml b/deployments/charts/kuma/crds/kuma.io_meshtraces.yaml index 2107140d32da..1105abdbd748 100644 --- a/deployments/charts/kuma/crds/kuma.io_meshtraces.yaml +++ b/deployments/charts/kuma/crds/kuma.io_meshtraces.yaml @@ -142,7 +142,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -153,13 +153,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -169,7 +169,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/docs/generated/openapi.yaml b/docs/generated/openapi.yaml index f51317ad11c5..40d5728c930f 100644 --- a/docs/generated/openapi.yaml +++ b/docs/generated/openapi.yaml @@ -10090,7 +10090,7 @@ components: anyOf: - type: integer - type: string - default: 100% + default: 100 description: >- Target percentage of requests that will be force traced if the @@ -10106,7 +10106,7 @@ components: anyOf: - type: integer - type: string - default: 100% + default: 100 description: >- Target percentage of requests will be traced @@ -10116,11 +10116,11 @@ components: random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting - client_sampling to 100% + configured sampling rate. For instance, setting client + to 100 - but overall_sampling to 1% will result in only 1% of - client requests with + but overall to 1 will result in only 1% of client + requests with the appropriate headers to be force traced. Mirror of @@ -10134,7 +10134,7 @@ components: anyOf: - type: integer - type: string - default: 100% + default: 100 description: >- Target percentage of requests that will be randomly selected for trace diff --git a/docs/generated/raw/crds/kuma.io_meshtraces.yaml b/docs/generated/raw/crds/kuma.io_meshtraces.yaml index 2107140d32da..1105abdbd748 100644 --- a/docs/generated/raw/crds/kuma.io_meshtraces.yaml +++ b/docs/generated/raw/crds/kuma.io_meshtraces.yaml @@ -142,7 +142,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -153,13 +153,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -169,7 +169,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/pkg/plugins/policies/meshtrace/api/v1alpha1/meshtrace.go b/pkg/plugins/policies/meshtrace/api/v1alpha1/meshtrace.go index 9514759189d3..388edf3abcbd 100644 --- a/pkg/plugins/policies/meshtrace/api/v1alpha1/meshtrace.go +++ b/pkg/plugins/policies/meshtrace/api/v1alpha1/meshtrace.go @@ -103,26 +103,26 @@ type Sampling struct { // Target percentage of requests will be traced // after all other sampling checks have been applied (client, force tracing, // random sampling). This field functions as an upper limit on the total - // configured sampling rate. For instance, setting client_sampling to 100% - // but overall_sampling to 1% will result in only 1% of client requests with + // configured sampling rate. For instance, setting client to 100 + // but overall to 1 will result in only 1% of client requests with // the appropriate headers to be force traced. Mirror of // overall_sampling in Envoy // https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 // Either int or decimal represented as string. - // +kubebuilder:default="100%" + // +kubebuilder:default=100 Overall *intstr.IntOrString `json:"overall,omitempty"` // Target percentage of requests that will be force traced if the // 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy // https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L127-L133 // Either int or decimal represented as string. - // +kubebuilder:default="100%" + // +kubebuilder:default=100 Client *intstr.IntOrString `json:"client,omitempty"` // Target percentage of requests that will be randomly selected for trace // generation, if not requested by the client or not forced. // Mirror of random_sampling in Envoy // https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L135-L140 // Either int or decimal represented as string. - // +kubebuilder:default="100%" + // +kubebuilder:default=100 Random *intstr.IntOrString `json:"random,omitempty"` } diff --git a/pkg/plugins/policies/meshtrace/api/v1alpha1/schema.yaml b/pkg/plugins/policies/meshtrace/api/v1alpha1/schema.yaml index ca40a42eb75d..cbb0116f2bf6 100644 --- a/pkg/plugins/policies/meshtrace/api/v1alpha1/schema.yaml +++ b/pkg/plugins/policies/meshtrace/api/v1alpha1/schema.yaml @@ -115,7 +115,7 @@ properties: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -126,13 +126,13 @@ properties: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -142,7 +142,7 @@ properties: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced. diff --git a/pkg/plugins/policies/meshtrace/k8s/crd/kuma.io_meshtraces.yaml b/pkg/plugins/policies/meshtrace/k8s/crd/kuma.io_meshtraces.yaml index 2107140d32da..1105abdbd748 100644 --- a/pkg/plugins/policies/meshtrace/k8s/crd/kuma.io_meshtraces.yaml +++ b/pkg/plugins/policies/meshtrace/k8s/crd/kuma.io_meshtraces.yaml @@ -142,7 +142,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be force traced if the 'x-client-trace-id' header is set. Mirror of client_sampling in Envoy @@ -153,13 +153,13 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests will be traced after all other sampling checks have been applied (client, force tracing, random sampling). This field functions as an upper limit on the total - configured sampling rate. For instance, setting client_sampling to 100% - but overall_sampling to 1% will result in only 1% of client requests with + configured sampling rate. For instance, setting client to 100 + but overall to 1 will result in only 1% of client requests with the appropriate headers to be force traced. Mirror of overall_sampling in Envoy https://github.com/envoyproxy/envoy/blob/v1.22.0/api/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto#L142-L150 @@ -169,7 +169,7 @@ spec: anyOf: - type: integer - type: string - default: 100% + default: 100 description: |- Target percentage of requests that will be randomly selected for trace generation, if not requested by the client or not forced.