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 CommandConfig from NetworkOptions #743

Merged
merged 4 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -157,7 +157,6 @@ func convertNetworkOptionsTo(srcOpts *NetworkConfigurationList) *operatorv1beta2
dstOpts = &operatorv1beta2.NetworkConfigurationList{
CoreConfig: convertNetworkConfigTo(srcOpts.CoreConfig),
GrafanaConfig: convertNetworkConfigTo(srcOpts.GrafanaConfig),
CommandConfig: convertNetworkConfigTo(srcOpts.CommandConfig), // TODO Remove this from v1beta2 API
}
}
return dstOpts
Expand Down Expand Up @@ -442,7 +441,6 @@ func convertNetworkOptionsFrom(srcOpts *operatorv1beta2.NetworkConfigurationList
dstOpts = &NetworkConfigurationList{
CoreConfig: convertNetworkConfigFrom(srcOpts.CoreConfig),
GrafanaConfig: convertNetworkConfigFrom(srcOpts.GrafanaConfig),
CommandConfig: convertNetworkConfigFrom(srcOpts.CommandConfig), // TODO Remove this from v1beta2 API
}
}
return dstOpts
Expand Down
7 changes: 5 additions & 2 deletions api/v1beta1/cryostat_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ var _ = Describe("Cryostat", func() {
})

func tableEntriesTo() []TableEntry {
return append(tableEntries(), Entry("WS connections", (*test.TestResources).NewCryostatWithWsConnectionsSpecV1Beta1,
(*test.TestResources).NewCryostat))
return append(tableEntries(),
Entry("WS connections", (*test.TestResources).NewCryostatWithWsConnectionsSpecV1Beta1,
(*test.TestResources).NewCryostat),
Entry("command config", (*test.TestResources).NewCryostatWithCommandConfigV1Beta1,
(*test.TestResources).NewCryostat))
mwangggg marked this conversation as resolved.
Show resolved Hide resolved
}

func tableEntriesFrom() []TableEntry {
Expand Down
7 changes: 0 additions & 7 deletions api/v1beta2/cryostat_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,6 @@ type NetworkConfigurationList struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec
CoreConfig *NetworkConfiguration `json:"coreConfig,omitempty"`
// Specifications for how to expose the Cryostat command service,
// which serves the WebSocket command channel.
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:hidden"}
//
// Deprecated: CommandConfig is no longer used.
CommandConfig *NetworkConfiguration `json:"commandConfig,omitempty"`
// Specifications for how to expose Cryostat's Grafana service,
// which serves the Grafana dashboard.
// +optional
Expand Down
5 changes: 0 additions & 5 deletions api/v1beta2/zz_generated.deepcopy.go

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

21 changes: 1 addition & 20 deletions bundle/manifests/cryostat-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ metadata:
capabilities: Seamless Upgrades
categories: Monitoring, Developer Tools
containerImage: quay.io/cryostat/cryostat-operator:2.5.0-dev
createdAt: "2024-03-08T17:20:54Z"
createdAt: "2024-03-11T18:51:35Z"
description: JVM monitoring and profiling tool
operatorframework.io/initialization-resource: |-
{
Expand Down Expand Up @@ -592,25 +592,6 @@ spec:
of the cluster, such as using an Ingress or Route.
displayName: Network Options
path: networkOptions
- description: "Specifications for how to expose the Cryostat command service,
which serves the WebSocket command channel. \n Deprecated: CommandConfig
is no longer used."
displayName: Command Config
path: networkOptions.commandConfig
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Annotations to add to the Ingress or Route during its creation.
displayName: Annotations
path: networkOptions.commandConfig.annotations
- description: Configuration for an Ingress object. Currently subpaths are not
supported, so unique hosts must be specified (if a single external IP is
being used) to differentiate between ingresses/services.
displayName: Ingress Spec
path: networkOptions.commandConfig.ingressSpec
- description: Labels to add to the Ingress or Route during its creation. The
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.commandConfig.labels
- description: Specifications for how to expose the Cryostat service, which
serves the Cryostat application.
displayName: Core Config
Expand Down
315 changes: 0 additions & 315 deletions bundle/manifests/operator.cryostat.io_cryostats.yaml

Large diffs are not rendered by default.

315 changes: 0 additions & 315 deletions config/crd/bases/operator.cryostat.io_cryostats.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -142,25 +142,6 @@ spec:
of the cluster, such as using an Ingress or Route.
displayName: Network Options
path: networkOptions
- description: "Specifications for how to expose the Cryostat command service,
which serves the WebSocket command channel. \n Deprecated: CommandConfig
is no longer used."
displayName: Command Config
path: networkOptions.commandConfig
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
- description: Annotations to add to the Ingress or Route during its creation.
displayName: Annotations
path: networkOptions.commandConfig.annotations
- description: Configuration for an Ingress object. Currently subpaths are not
supported, so unique hosts must be specified (if a single external IP is
being used) to differentiate between ingresses/services.
displayName: Ingress Spec
path: networkOptions.commandConfig.ingressSpec
- description: Labels to add to the Ingress or Route during its creation. The
label with key "app" is reserved for use by the operator.
displayName: Labels
path: networkOptions.commandConfig.labels
- description: Specifications for how to expose the Cryostat service, which
serves the Cryostat application.
displayName: Core Config
Expand Down
13 changes: 13 additions & 0 deletions internal/test/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,19 @@ func (r *TestResources) NewCryostatWithWsConnectionsSpecV1Beta1() *operatorv1bet
return cr
}

func (r *TestResources) NewCryostatWithCommandConfigV1Beta1() *operatorv1beta1.Cryostat {
commandSVC := r.NewCommandService()
commandIng := r.newNetworkConfigurationV1Beta1(commandSVC.Name, commandSVC.Spec.Ports[0].Port)
commandIng.Annotations["command"] = "annotation"
commandIng.Labels["command"] = "label"

cr := r.NewCryostatV1Beta1()
cr.Spec.NetworkOptions = &operatorv1beta1.NetworkConfigurationList{
CommandConfig: &commandIng,
}
return cr
}

func (r *TestResources) NewCryostatWithReportSubprocessHeapSpecV1Beta1() *operatorv1beta1.Cryostat {
cr := r.NewCryostatV1Beta1()
if cr.Spec.ReportOptions == nil {
Expand Down
37 changes: 37 additions & 0 deletions internal/test/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,43 @@ func (r *TestResources) NewGrafanaService() *corev1.Service {
}
}

func (r *TestResources) NewCommandService() *corev1.Service {
c := true
return &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: r.Name + "-command",
Namespace: r.Namespace,
OwnerReferences: []metav1.OwnerReference{
{
APIVersion: operatorv1beta2.GroupVersion.String(),
Kind: "Cryostat",
Name: r.Name,
UID: "",
Controller: &c,
},
},
Labels: map[string]string{
"app": r.Name,
"component": "cryostat",
},
},
Spec: corev1.ServiceSpec{
Type: corev1.ServiceTypeClusterIP,
Selector: map[string]string{
"app": r.Name,
"component": "cryostat",
},
Ports: []corev1.ServicePort{
{
Name: "http",
Port: 10001,
TargetPort: intstr.FromInt(10001),
},
},
},
}
}

func (r *TestResources) NewReportsService() *corev1.Service {
c := true
return &corev1.Service{
Expand Down
Loading