From df885d7f5c9c552845383caba347afba0030b14a Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Tue, 27 Feb 2024 17:11:12 -0500 Subject: [PATCH] remove MaxWsConnections --- api/v1beta1/cryostat_conversion.go | 2 -- api/v1beta1/cryostat_conversion_test.go | 2 -- api/v1beta1/cryostat_types.go | 5 ----- api/v1beta2/cryostat_types.go | 5 ----- .../cryostat-operator.clusterserviceversion.yaml | 12 ------------ .../manifests/operator.cryostat.io_cryostats.yaml | 12 ------------ .../crd/bases/operator.cryostat.io_cryostats.yaml | 12 ------------ .../cryostat-operator.clusterserviceversion.yaml | 12 ------------ docs/config.md | 12 ------------ .../resource_definitions/resource_definitions.go | 11 ----------- internal/controllers/reconciler_test.go | 8 -------- internal/test/conversion.go | 6 ------ internal/test/resources.go | 15 --------------- 13 files changed, 114 deletions(-) diff --git a/api/v1beta1/cryostat_conversion.go b/api/v1beta1/cryostat_conversion.go index fd818f608..bb56a27cd 100644 --- a/api/v1beta1/cryostat_conversion.go +++ b/api/v1beta1/cryostat_conversion.go @@ -50,7 +50,6 @@ func convertSpecTo(src *CryostatSpec, dst *operatorv1beta2.CryostatSpec) { dst.ServiceOptions = convertServiceOptionsTo(src.ServiceOptions) dst.NetworkOptions = convertNetworkOptionsTo(src.NetworkOptions) dst.ReportOptions = convertReportOptionsTo(src.ReportOptions) - dst.MaxWsConnections = src.MaxWsConnections dst.JmxCacheOptions = convertJmxCacheOptionsTo(src.JmxCacheOptions) dst.Resources = convertResourceOptionsTo(src.Resources) dst.AuthProperties = convertAuthPropertiesTo(src.AuthProperties) @@ -336,7 +335,6 @@ func convertSpecFrom(src *operatorv1beta2.CryostatSpec, dst *CryostatSpec) { dst.ServiceOptions = convertServiceOptionsFrom(src.ServiceOptions) dst.NetworkOptions = convertNetworkOptionsFrom(src.NetworkOptions) dst.ReportOptions = convertReportOptionsFrom(src.ReportOptions) - dst.MaxWsConnections = src.MaxWsConnections dst.JmxCacheOptions = convertJmxCacheOptionsFrom(src.JmxCacheOptions) dst.Resources = convertResourceOptionsFrom(src.Resources) dst.AuthProperties = convertAuthPropertiesFrom(src.AuthProperties) diff --git a/api/v1beta1/cryostat_conversion_test.go b/api/v1beta1/cryostat_conversion_test.go index ae9129692..591826ecd 100644 --- a/api/v1beta1/cryostat_conversion_test.go +++ b/api/v1beta1/cryostat_conversion_test.go @@ -134,8 +134,6 @@ func tableEntries() []TableEntry { (*test.TestResources).NewCryostatWithBuiltInPortConfigDisabled), Entry("JMX cache options", (*test.TestResources).NewCryostatWithJmxCacheOptionsSpecV1Beta1, (*test.TestResources).NewCryostatWithJmxCacheOptionsSpec), - Entry("WS connections", (*test.TestResources).NewCryostatWithWsConnectionsSpecV1Beta1, - (*test.TestResources).NewCryostatWithWsConnectionsSpec), Entry("subprocess heap", (*test.TestResources).NewCryostatWithReportSubprocessHeapSpecV1Beta1, (*test.TestResources).NewCryostatWithReportSubprocessHeapSpec), Entry("security", (*test.TestResources).NewCryostatWithSecurityOptionsV1Beta1, diff --git a/api/v1beta1/cryostat_types.go b/api/v1beta1/cryostat_types.go index a480a28c6..4d5ed0809 100644 --- a/api/v1beta1/cryostat_types.go +++ b/api/v1beta1/cryostat_types.go @@ -55,11 +55,6 @@ type CryostatSpec struct { // +optional // +operator-sdk:csv:customresourcedefinitions:type=spec ReportOptions *ReportConfiguration `json:"reportOptions,omitempty"` - // The maximum number of WebSocket client connections allowed (minimum 1, default unlimited). - // +optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Max WebSocket Connections",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:number"} - // +kubebuilder:validation:Minimum=1 - MaxWsConnections int32 `json:"maxWsConnections,omitempty"` // Options to customize the JMX target connections cache for the Cryostat application. // +optional // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="JMX Connections Cache Options" diff --git a/api/v1beta2/cryostat_types.go b/api/v1beta2/cryostat_types.go index e0e1f5279..5bd3a8584 100644 --- a/api/v1beta2/cryostat_types.go +++ b/api/v1beta2/cryostat_types.go @@ -64,11 +64,6 @@ type CryostatSpec struct { // +optional // +operator-sdk:csv:customresourcedefinitions:type=spec ReportOptions *ReportConfiguration `json:"reportOptions,omitempty"` - // The maximum number of WebSocket client connections allowed (minimum 1, default unlimited). - // +optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Max WebSocket Connections",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:number"} - // +kubebuilder:validation:Minimum=1 - MaxWsConnections int32 `json:"maxWsConnections,omitempty"` // Options to customize the JMX target connections cache for the Cryostat application. // +optional // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="JMX Connections Cache Options" diff --git a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml index 5cb15f3da..80c9c28d2 100644 --- a/bundle/manifests/cryostat-operator.clusterserviceversion.yaml +++ b/bundle/manifests/cryostat-operator.clusterserviceversion.yaml @@ -182,12 +182,6 @@ spec: path: jmxCredentialsDatabaseOptions.databaseSecretName x-descriptors: - urn:alm:descriptor:io.kubernetes:Secret - - description: The maximum number of WebSocket client connections allowed (minimum - 1, default unlimited). - displayName: Max WebSocket Connections - path: maxWsConnections - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:number - description: Options to control how the operator exposes the application outside of the cluster, such as using an Ingress or Route. displayName: Network Options @@ -588,12 +582,6 @@ spec: path: jmxCredentialsDatabaseOptions.databaseSecretName x-descriptors: - urn:alm:descriptor:io.kubernetes:Secret - - description: The maximum number of WebSocket client connections allowed (minimum - 1, default unlimited). - displayName: Max WebSocket Connections - path: maxWsConnections - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:number - description: Options to control how the operator exposes the application outside of the cluster, such as using an Ingress or Route. displayName: Network Options diff --git a/bundle/manifests/operator.cryostat.io_cryostats.yaml b/bundle/manifests/operator.cryostat.io_cryostats.yaml index 26a20df2b..cf3940874 100644 --- a/bundle/manifests/operator.cryostat.io_cryostats.yaml +++ b/bundle/manifests/operator.cryostat.io_cryostats.yaml @@ -127,12 +127,6 @@ spec: credentials database. type: string type: object - maxWsConnections: - description: The maximum number of WebSocket client connections allowed - (minimum 1, default unlimited). - format: int32 - minimum: 1 - type: integer minimal: description: Deploy a pared-down Cryostat instance with no Grafana Dashboard or JFR Data Source. @@ -4844,12 +4838,6 @@ spec: credentials database. type: string type: object - maxWsConnections: - description: The maximum number of WebSocket client connections allowed - (minimum 1, default unlimited). - format: int32 - minimum: 1 - type: integer minimal: description: Deploy a pared-down Cryostat instance with no Grafana Dashboard or JFR Data Source. diff --git a/config/crd/bases/operator.cryostat.io_cryostats.yaml b/config/crd/bases/operator.cryostat.io_cryostats.yaml index 694eaaa07..11de5de7c 100644 --- a/config/crd/bases/operator.cryostat.io_cryostats.yaml +++ b/config/crd/bases/operator.cryostat.io_cryostats.yaml @@ -117,12 +117,6 @@ spec: credentials database. type: string type: object - maxWsConnections: - description: The maximum number of WebSocket client connections allowed - (minimum 1, default unlimited). - format: int32 - minimum: 1 - type: integer minimal: description: Deploy a pared-down Cryostat instance with no Grafana Dashboard or JFR Data Source. @@ -4834,12 +4828,6 @@ spec: credentials database. type: string type: object - maxWsConnections: - description: The maximum number of WebSocket client connections allowed - (minimum 1, default unlimited). - format: int32 - minimum: 1 - type: integer minimal: description: Deploy a pared-down Cryostat instance with no Grafana Dashboard or JFR Data Source. diff --git a/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml b/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml index 6b5b54117..a53b0a9f5 100644 --- a/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cryostat-operator.clusterserviceversion.yaml @@ -138,12 +138,6 @@ spec: path: jmxCredentialsDatabaseOptions.databaseSecretName x-descriptors: - urn:alm:descriptor:io.kubernetes:Secret - - description: The maximum number of WebSocket client connections allowed (minimum - 1, default unlimited). - displayName: Max WebSocket Connections - path: maxWsConnections - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:number - description: Options to control how the operator exposes the application outside of the cluster, such as using an Ingress or Route. displayName: Network Options @@ -542,12 +536,6 @@ spec: path: jmxCredentialsDatabaseOptions.databaseSecretName x-descriptors: - urn:alm:descriptor:io.kubernetes:Secret - - description: The maximum number of WebSocket client connections allowed (minimum - 1, default unlimited). - displayName: Max WebSocket Connections - path: maxWsConnections - x-descriptors: - - urn:alm:descriptor:com.tectonic.ui:number - description: Options to control how the operator exposes the application outside of the cluster, such as using an Ingress or Route. displayName: Network Options diff --git a/docs/config.md b/docs/config.md index a57840b0c..afb374637 100644 --- a/docs/config.md +++ b/docs/config.md @@ -281,18 +281,6 @@ spec: When running on OpenShift, labels and annotations specified in `coreConfig` and `grafanaConfig` will be applied to the coresponding Routes created by the operator. -### Cryostat Client Options -The `maxWsConnections` property optionally specifies the maximum number of WebSocket client connections allowed. -The default number of `maxWsConnections` is unlimited. -```yaml -apiVersion: operator.cryostat.io/v1beta1 -kind: Cryostat -metadata: - name: cryostat-sample -spec: - maxWsConnections: 2 -``` - ### JMX Cache Configuration Options Cryostat's target JMX connection cache can be optionally configured with `targetCacheSize` and `targetCacheTTL`. `targetCacheSize` sets the maximum number of JMX connections cached by Cryostat. diff --git a/internal/controllers/common/resource_definitions/resource_definitions.go b/internal/controllers/common/resource_definitions/resource_definitions.go index 5386aea96..06c1a9d65 100644 --- a/internal/controllers/common/resource_definitions/resource_definitions.go +++ b/internal/controllers/common/resource_definitions/resource_definitions.go @@ -737,17 +737,6 @@ func NewCoreContainer(cr *model.CryostatInstance, specs *ServiceSpecs, imageTag envs = append(envs, insightsEnvs...) } - if cr.Spec.MaxWsConnections != 0 { - maxWsConnections := strconv.Itoa(int(cr.Spec.MaxWsConnections)) - maxWsConnectionsEnv := []corev1.EnvVar{ - { - Name: "CRYOSTAT_MAX_WS_CONNECTIONS", - Value: maxWsConnections, - }, - } - envs = append(envs, maxWsConnectionsEnv...) - } - targetCacheSize := "-1" targetCacheTTL := "10" if cr.Spec.JmxCacheOptions != nil { diff --git a/internal/controllers/reconciler_test.go b/internal/controllers/reconciler_test.go index 306455510..b6e2657ba 100644 --- a/internal/controllers/reconciler_test.go +++ b/internal/controllers/reconciler_test.go @@ -1622,14 +1622,6 @@ func (c *controllerTest) commonTests() { JustBeforeEach(func() { t.reconcileCryostatFully() }) - Context("containing MaxWsConnections", func() { - BeforeEach(func() { - t.objs = append(t.objs, t.NewCryostatWithWsConnectionsSpec().Object) - }) - It("should set max WebSocket connections", func() { - t.checkCoreHasEnvironmentVariables(t.NewWsConnectionsEnv()) - }) - }) Context("containing SubProcessMaxHeapSize", func() { BeforeEach(func() { t.objs = append(t.objs, t.NewCryostatWithReportSubprocessHeapSpec().Object) diff --git a/internal/test/conversion.go b/internal/test/conversion.go index ab123ddd3..561db6642 100644 --- a/internal/test/conversion.go +++ b/internal/test/conversion.go @@ -472,12 +472,6 @@ func (r *TestResources) NewCryostatWithJmxCacheOptionsSpecV1Beta1() *operatorv1b return cr } -func (r *TestResources) NewCryostatWithWsConnectionsSpecV1Beta1() *operatorv1beta1.Cryostat { - cr := r.NewCryostatV1Beta1() - cr.Spec.MaxWsConnections = 10 - return cr -} - func (r *TestResources) NewCryostatWithReportSubprocessHeapSpecV1Beta1() *operatorv1beta1.Cryostat { cr := r.NewCryostatV1Beta1() if cr.Spec.ReportOptions == nil { diff --git a/internal/test/resources.go b/internal/test/resources.go index 1f4e16889..d94ac5403 100644 --- a/internal/test/resources.go +++ b/internal/test/resources.go @@ -560,12 +560,6 @@ func (r *TestResources) NewCryostatWithJmxCacheOptionsSpec() *model.CryostatInst return cr } -func (r *TestResources) NewCryostatWithWsConnectionsSpec() *model.CryostatInstance { - cr := r.NewCryostat() - cr.Spec.MaxWsConnections = 10 - return cr -} - func (r *TestResources) NewCryostatWithReportSubprocessHeapSpec() *model.CryostatInstance { cr := r.NewCryostat() if cr.Spec.ReportOptions == nil { @@ -1578,15 +1572,6 @@ func (r *TestResources) NewGrafanaEnvFromSource() []corev1.EnvFromSource { } } -func (r *TestResources) NewWsConnectionsEnv() []corev1.EnvVar { - return []corev1.EnvVar{ - { - Name: "CRYOSTAT_MAX_WS_CONNECTIONS", - Value: "10", - }, - } -} - func (r *TestResources) NewReportSubprocessHeapEnv() []corev1.EnvVar { return []corev1.EnvVar{ {