Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): remove MaxWsConnections #742

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
15 changes: 11 additions & 4 deletions api/v1beta1/cryostat_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var _ = Describe("Cryostat", func() {

Expect(converted).To(Equal(newCR))
},
tableEntries(),
tableEntriesTo(),
)

DescribeTable("converting from v1beta2 to v1beta1",
Expand All @@ -71,11 +71,20 @@ var _ = Describe("Cryostat", func() {

Expect(converted).To(Equal(oldCR))
},
tableEntries(),
tableEntriesFrom(),
)

})

func tableEntriesTo() []TableEntry {
return append(tableEntries(), Entry("WS connections", (*test.TestResources).NewCryostatWithWsConnectionsSpecV1Beta1,
(*test.TestResources).NewCryostat))
}

func tableEntriesFrom() []TableEntry {
return tableEntries()
}

func tableEntries() []TableEntry {
return []TableEntry{
Entry("defaults", (*test.TestResources).NewCryostatV1Beta1,
Expand Down Expand Up @@ -134,8 +143,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),
ebaron marked this conversation as resolved.
Show resolved Hide resolved
Entry("subprocess heap", (*test.TestResources).NewCryostatWithReportSubprocessHeapSpecV1Beta1,
(*test.TestResources).NewCryostatWithReportSubprocessHeapSpec),
Entry("security", (*test.TestResources).NewCryostatWithSecurityOptionsV1Beta1,
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
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
Loading