Skip to content

Commit

Permalink
feat(discovery): discovery port name/number options for v1betav2 (#733)
Browse files Browse the repository at this point in the history
* feat(discovery): discovery port name/number options for v1betav2

* fix(conversion): add missing conversion to betav1
  • Loading branch information
tthvo authored and andrewazores committed Feb 22, 2024
1 parent c981a96 commit 1613624
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 8 deletions.
12 changes: 10 additions & 2 deletions api/v1beta1/cryostat_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ func convertTargetDiscoveryTo(srcOpts *TargetDiscoveryOptions) *operatorv1beta2.
var dstOpts *operatorv1beta2.TargetDiscoveryOptions
if srcOpts != nil {
dstOpts = &operatorv1beta2.TargetDiscoveryOptions{
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
DisableBuiltInPortNames: srcOpts.DisableBuiltInPortNames,
DiscoveryPortNames: srcOpts.DiscoveryPortNames,
DisableBuiltInPortNumbers: srcOpts.DisableBuiltInPortNumbers,
DiscoveryPortNumbers: srcOpts.DiscoveryPortNumbers,
}
}
return dstOpts
Expand Down Expand Up @@ -551,7 +555,11 @@ func convertTargetDiscoveryFrom(srcOpts *operatorv1beta2.TargetDiscoveryOptions)
var dstOpts *TargetDiscoveryOptions
if srcOpts != nil {
dstOpts = &TargetDiscoveryOptions{
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
DisableBuiltInPortNames: srcOpts.DisableBuiltInPortNames,
DiscoveryPortNames: srcOpts.DiscoveryPortNames,
DisableBuiltInPortNumbers: srcOpts.DisableBuiltInPortNumbers,
DiscoveryPortNumbers: srcOpts.DiscoveryPortNumbers,
}
}
return dstOpts
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/cryostat_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func tableEntries() []TableEntry {
(*test.TestResources).NewCryostatWithAuthProperties),
Entry("built-in discovery disabled", (*test.TestResources).NewCryostatWithBuiltInDiscoveryDisabledV1Beta1,
(*test.TestResources).NewCryostatWithBuiltInDiscoveryDisabled),
Entry("discovery port custom config", (*test.TestResources).NewCryostatWithDiscoveryPortConfigV1Beta1,
(*test.TestResources).NewCryostatWithDiscoveryPortConfig),
Entry("discovery port config disabled", (*test.TestResources).NewCryostatWithBuiltInPortConfigDisabledV1Beta1,
(*test.TestResources).NewCryostatWithBuiltInPortConfigDisabled),
Entry("JMX cache options", (*test.TestResources).NewCryostatWithJmxCacheOptionsSpecV1Beta1,
(*test.TestResources).NewCryostatWithJmxCacheOptionsSpec),
Entry("WS connections", (*test.TestResources).NewCryostatWithWsConnectionsSpecV1Beta1,
Expand Down
16 changes: 16 additions & 0 deletions api/v1beta2/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,22 @@ type TargetDiscoveryOptions struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Disable Built-in Discovery",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
BuiltInDiscoveryDisabled bool `json:"builtInDiscoveryDisabled,omitempty"`
// When true, the Cryostat application will use the default port name jfr-jmx to look for JMX connectable targets.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Disable Built-in Port Names",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
DisableBuiltInPortNames bool `json:"disableBuiltInPortNames,omitempty"`
// List of port names that the Cryostat application should look for in order to consider a target as JMX connectable.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNames:true"}
DiscoveryPortNames []string `json:"discoveryPortNames,omitempty"`
// When true, the Cryostat application will use the default port number 9091 to look for JMX connectable targets.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Disable Built-in Port Numbers",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
DisableBuiltInPortNumbers bool `json:"disableBuiltInPortNumbers,omitempty"`
// List of port numbers that the Cryostat application should look for in order to consider a target as JMX connectable.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNumbers:true"}
DiscoveryPortNumbers []int32 `json:"discoveryPortNumbers,omitempty"`
}

// JmxCredentialsDatabaseOptions provides configuration options to the Cryostat application's credentials database.
Expand Down
12 changes: 11 additions & 1 deletion api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 51 additions & 3 deletions bundle/manifests/cryostat-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:2.5.0-dev
createdAt: "2024-02-12T22:09:00Z"
createdAt: "2024-02-14T20:36:04Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
Expand Down Expand Up @@ -490,11 +490,35 @@ spec:
displayName: Target Discovery Options
path: targetDiscoveryOptions
- description: When true, the Cryostat application will disable the built-in
discovery mechanisms. Defaults to false
discovery mechanisms. Defaults to false.
displayName: Disable Built-in Discovery
path: targetDiscoveryOptions.builtInDiscoveryDisabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
name jfr-jmx to look for JMX connectable targets.
displayName: Disable Built-in Port Names
path: targetDiscoveryOptions.disableBuiltInPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
number 9091 to look for JMX connectable targets.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: List of port names that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Names
path: targetDiscoveryOptions.discoveryPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNames:true
- description: List of port numbers that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Numbers
path: targetDiscoveryOptions.discoveryPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNumbers:true
- description: List of TLS certificates to trust when connecting to targets.
displayName: Trusted TLS Certificates
path: trustedCertSecrets
Expand Down Expand Up @@ -900,6 +924,30 @@ spec:
path: targetDiscoveryOptions.builtInDiscoveryDisabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
name jfr-jmx to look for JMX connectable targets.
displayName: Disable Built-in Port Names
path: targetDiscoveryOptions.disableBuiltInPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
number 9091 to look for JMX connectable targets.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: List of port names that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Names
path: targetDiscoveryOptions.discoveryPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNames:true
- description: List of port numbers that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Numbers
path: targetDiscoveryOptions.discoveryPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNumbers:true
- description: List of TLS certificates to trust when connecting to targets.
displayName: Trusted TLS Certificates
path: trustedCertSecrets
Expand Down Expand Up @@ -1693,7 +1741,7 @@ spec:
displayName: Target Discovery Options
path: targetDiscoveryOptions
- description: When true, the Cryostat application will disable the built-in
discovery mechanisms. Defaults to false.
discovery mechanisms. Defaults to false
displayName: Disable Built-in Discovery
path: targetDiscoveryOptions.builtInDiscoveryDisabled
x-descriptors:
Expand Down
21 changes: 21 additions & 0 deletions bundle/manifests/operator.cryostat.io_clustercryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9355,6 +9355,27 @@ spec:
description: When true, the Cryostat application will disable
the built-in discovery mechanisms. Defaults to false
type: boolean
disableBuiltInPortNames:
description: When true, the Cryostat application will use the
default port name jfr-jmx to look for JMX connectable targets.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
type: string
type: array
discoveryPortNumbers:
description: List of port numbers that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
format: int32
type: integer
type: array
type: object
targetNamespaces:
description: 'List of namespaces whose workloads Cryostat should be
Expand Down
21 changes: 21 additions & 0 deletions bundle/manifests/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9332,6 +9332,27 @@ spec:
description: When true, the Cryostat application will disable
the built-in discovery mechanisms. Defaults to false
type: boolean
disableBuiltInPortNames:
description: When true, the Cryostat application will use the
default port name jfr-jmx to look for JMX connectable targets.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
type: string
type: array
discoveryPortNumbers:
description: List of port numbers that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
format: int32
type: integer
type: array
type: object
targetNamespaces:
description: 'List of namespaces whose workloads Cryostat should be
Expand Down
21 changes: 21 additions & 0 deletions config/crd/bases/operator.cryostat.io_clustercryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9345,6 +9345,27 @@ spec:
description: When true, the Cryostat application will disable
the built-in discovery mechanisms. Defaults to false
type: boolean
disableBuiltInPortNames:
description: When true, the Cryostat application will use the
default port name jfr-jmx to look for JMX connectable targets.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
type: string
type: array
discoveryPortNumbers:
description: List of port numbers that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
format: int32
type: integer
type: array
type: object
targetNamespaces:
description: 'List of namespaces whose workloads Cryostat should be
Expand Down
21 changes: 21 additions & 0 deletions config/crd/bases/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9322,6 +9322,27 @@ spec:
description: When true, the Cryostat application will disable
the built-in discovery mechanisms. Defaults to false
type: boolean
disableBuiltInPortNames:
description: When true, the Cryostat application will use the
default port name jfr-jmx to look for JMX connectable targets.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
type: string
type: array
discoveryPortNumbers:
description: List of port numbers that the Cryostat application
should look for in order to consider a target as JMX connectable.
items:
format: int32
type: integer
type: array
type: object
targetNamespaces:
description: 'List of namespaces whose workloads Cryostat should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,30 @@ spec:
path: targetDiscoveryOptions.builtInDiscoveryDisabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
name jfr-jmx to look for JMX connectable targets.
displayName: Disable Built-in Port Names
path: targetDiscoveryOptions.disableBuiltInPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
number 9091 to look for JMX connectable targets.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: List of port names that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Names
path: targetDiscoveryOptions.discoveryPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNames:true
- description: List of port numbers that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Numbers
path: targetDiscoveryOptions.discoveryPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNumbers:true
- description: List of TLS certificates to trust when connecting to targets.
displayName: Trusted TLS Certificates
path: trustedCertSecrets
Expand Down Expand Up @@ -1202,6 +1226,30 @@ spec:
path: targetDiscoveryOptions.builtInDiscoveryDisabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
name jfr-jmx to look for JMX connectable targets.
displayName: Disable Built-in Port Names
path: targetDiscoveryOptions.disableBuiltInPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: When true, the Cryostat application will use the default port
number 9091 to look for JMX connectable targets.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: List of port names that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Names
path: targetDiscoveryOptions.discoveryPortNames
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNames:true
- description: List of port numbers that the Cryostat application should look
for in order to consider a target as JMX connectable.
displayName: Discovery Port Numbers
path: targetDiscoveryOptions.discoveryPortNumbers
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:targetDiscoveryOptions.disableBuiltInPortNumbers:true
- description: List of TLS certificates to trust when connecting to targets.
displayName: Trusted TLS Certificates
path: trustedCertSecrets
Expand Down
Loading

0 comments on commit 1613624

Please sign in to comment.