Skip to content

Commit

Permalink
chore(discovery): ensure consistent names for discovery options in CRD
Browse files Browse the repository at this point in the history
Signed-off-by: Thuan Vo <thuan.votann@gmail.com>
  • Loading branch information
tthvo committed May 22, 2024
1 parent ad96512 commit 37a065f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 27 deletions.
4 changes: 2 additions & 2 deletions api/v1beta1/cryostat_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func convertTargetDiscoveryTo(srcOpts *TargetDiscoveryOptions) *operatorv1beta2.
var dstOpts *operatorv1beta2.TargetDiscoveryOptions
if srcOpts != nil {
dstOpts = &operatorv1beta2.TargetDiscoveryOptions{
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
BuiltInDiscoveryDisabled: srcOpts.DisableBuiltInDiscovery,
DisableBuiltInPortNames: srcOpts.DisableBuiltInPortNames,
DiscoveryPortNames: srcOpts.DiscoveryPortNames,
DisableBuiltInPortNumbers: srcOpts.DisableBuiltInPortNumbers,
Expand Down Expand Up @@ -507,7 +507,7 @@ func convertTargetDiscoveryFrom(srcOpts *operatorv1beta2.TargetDiscoveryOptions)
var dstOpts *TargetDiscoveryOptions
if srcOpts != nil {
dstOpts = &TargetDiscoveryOptions{
BuiltInDiscoveryDisabled: srcOpts.BuiltInDiscoveryDisabled,
DisableBuiltInDiscovery: srcOpts.BuiltInDiscoveryDisabled,
DisableBuiltInPortNames: srcOpts.DisableBuiltInPortNames,
DiscoveryPortNames: srcOpts.DiscoveryPortNames,
DisableBuiltInPortNumbers: srcOpts.DisableBuiltInPortNumbers,
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,16 +540,16 @@ type TargetDiscoveryOptions struct {
// When true, the Cryostat application will disable the built-in discovery mechanisms. Defaults to false.
// +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.
DisableBuiltInDiscovery bool `json:"DisablebuiltInDiscovery,omitempty"`
// When false and discoveryPortNames is empty, the Cryostat application will use the default port name jfr-jmx to look for JMX connectable targets. Defaults to false.
// +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.
// When false and discoveryPortNumbers is empty, the Cryostat application will use the default port number 9091 to look for JMX connectable targets. Defaults to false.
// +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"`
Expand Down
14 changes: 8 additions & 6 deletions bundle/manifests/cryostat-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:3.0.0-dev
createdAt: "2024-05-20T05:12:58Z"
createdAt: "2024-05-22T04:59:49Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
Expand Down Expand Up @@ -437,17 +437,19 @@ spec:
- description: When true, the Cryostat application will disable the built-in
discovery mechanisms. Defaults to false.
displayName: Disable Built-in Discovery
path: targetDiscoveryOptions.builtInDiscoveryDisabled
path: targetDiscoveryOptions.DisablebuiltInDiscovery
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.
- description: When false and discoveryPortNames is empty, the Cryostat application
will use the default port name jfr-jmx to look for JMX connectable targets.
Defaults to false.
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.
- description: When false and discoveryPortNumbers is empty, the Cryostat application
will use the default port number 9091 to look for JMX connectable targets.
Defaults to false.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
Expand Down
12 changes: 7 additions & 5 deletions bundle/manifests/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4962,17 +4962,19 @@ spec:
description: Options to configure the Cryostat application's target
discovery mechanisms.
properties:
builtInDiscoveryDisabled:
DisablebuiltInDiscovery:
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.
description: When false and discoveryPortNames is empty, the Cryostat
application will use the default port name jfr-jmx to look for
JMX connectable targets. Defaults to false.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
description: When false and discoveryPortNumbers is empty, the
Cryostat application will use the default port number 9091 to
look for JMX connectable targets. Defaults to false.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
Expand Down
12 changes: 7 additions & 5 deletions config/crd/bases/operator.cryostat.io_cryostats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4952,17 +4952,19 @@ spec:
description: Options to configure the Cryostat application's target
discovery mechanisms.
properties:
builtInDiscoveryDisabled:
DisablebuiltInDiscovery:
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.
description: When false and discoveryPortNames is empty, the Cryostat
application will use the default port name jfr-jmx to look for
JMX connectable targets. Defaults to false.
type: boolean
disableBuiltInPortNumbers:
description: When true, the Cryostat application will use the
default port number 9091 to look for JMX connectable targets.
description: When false and discoveryPortNumbers is empty, the
Cryostat application will use the default port number 9091 to
look for JMX connectable targets. Defaults to false.
type: boolean
discoveryPortNames:
description: List of port names that the Cryostat application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,17 +804,19 @@ spec:
- description: When true, the Cryostat application will disable the built-in
discovery mechanisms. Defaults to false.
displayName: Disable Built-in Discovery
path: targetDiscoveryOptions.builtInDiscoveryDisabled
path: targetDiscoveryOptions.DisablebuiltInDiscovery
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.
- description: When false and discoveryPortNames is empty, the Cryostat application
will use the default port name jfr-jmx to look for JMX connectable targets.
Defaults to false.
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.
- description: When false and discoveryPortNumbers is empty, the Cryostat application
will use the default port number 9091 to look for JMX connectable targets.
Defaults to false.
displayName: Disable Built-in Port Numbers
path: targetDiscoveryOptions.disableBuiltInPortNumbers
x-descriptors:
Expand Down
2 changes: 1 addition & 1 deletion internal/test/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (r *TestResources) NewCryostatWithAuthPropertiesV1Beta1() *operatorv1beta1.
func (r *TestResources) NewCryostatWithBuiltInDiscoveryDisabledV1Beta1() *operatorv1beta1.Cryostat {
cr := r.NewCryostatV1Beta1()
cr.Spec.TargetDiscoveryOptions = &operatorv1beta1.TargetDiscoveryOptions{
BuiltInDiscoveryDisabled: true,
DisableBuiltInDiscovery: true,
}
return cr
}
Expand Down

0 comments on commit 37a065f

Please sign in to comment.