Skip to content

Commit

Permalink
remove MaxWsConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Feb 27, 2024
1 parent 5b66ff1 commit df885d7
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 114 deletions.
2 changes: 0 additions & 2 deletions api/v1beta1/cryostat_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions api/v1beta1/cryostat_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions api/v1beta1/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions api/v1beta2/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 0 additions & 12 deletions bundle/manifests/cryostat-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions bundle/manifests/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
12 changes: 0 additions & 12 deletions config/crd/bases/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 0 additions & 8 deletions internal/controllers/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions internal/test/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 0 additions & 15 deletions internal/test/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
{
Expand Down

0 comments on commit df885d7

Please sign in to comment.