diff --git a/bundle/manifests/observability.openshift.io_uiplugins.yaml b/bundle/manifests/observability.openshift.io_uiplugins.yaml index 3bbd6147d..cc89cbca2 100644 --- a/bundle/manifests/observability.openshift.io_uiplugins.yaml +++ b/bundle/manifests/observability.openshift.io_uiplugins.yaml @@ -181,6 +181,12 @@ spec: - type type: object x-kubernetes-validations: + - message: Troubleshooting Panel configuration is only supported with + the TroubleshootingPanel type + rule: self.type == 'TroubleshootingPanel' || !has(self.troubleshootingPanel) + - message: Distributed Tracing configuration is only supported with the + DistributedTracing type + rule: self.type == 'DistributedTracing' || !has(self.distributedTracing) - message: Logging configuration is required if type is Logging rule: self.type != 'Logging' || has(self.logging) status: diff --git a/deploy/crds/common/observability.openshift.io_uiplugins.yaml b/deploy/crds/common/observability.openshift.io_uiplugins.yaml index fb36144a4..601e75417 100644 --- a/deploy/crds/common/observability.openshift.io_uiplugins.yaml +++ b/deploy/crds/common/observability.openshift.io_uiplugins.yaml @@ -181,6 +181,12 @@ spec: - type type: object x-kubernetes-validations: + - message: Troubleshooting Panel configuration is only supported with + the TroubleshootingPanel type + rule: self.type == 'TroubleshootingPanel' || !has(self.troubleshootingPanel) + - message: Distributed Tracing configuration is only supported with the + DistributedTracing type + rule: self.type == 'DistributedTracing' || !has(self.distributedTracing) - message: Logging configuration is required if type is Logging rule: self.type != 'Logging' || has(self.logging) status: diff --git a/pkg/apis/uiplugin/v1alpha1/types.go b/pkg/apis/uiplugin/v1alpha1/types.go index 15220d954..512959398 100644 --- a/pkg/apis/uiplugin/v1alpha1/types.go +++ b/pkg/apis/uiplugin/v1alpha1/types.go @@ -149,6 +149,8 @@ type LokiStackReference struct { // UIPluginSpec is the specification for desired state of UIPlugin. // +// +kubebuilder:validation:XValidation:rule="self.type == 'TroubleshootingPanel' || !has(self.troubleshootingPanel)", message="Troubleshooting Panel configuration is only supported with the TroubleshootingPanel type" +// +kubebuilder:validation:XValidation:rule="self.type == 'DistributedTracing' || !has(self.distributedTracing)", message="Distributed Tracing configuration is only supported with the DistributedTracing type" // +kubebuilder:validation:XValidation:rule="self.type != 'Logging' || has(self.logging)", message="Logging configuration is required if type is Logging" type UIPluginSpec struct { // Type defines the UI plugin.