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

COO-178: fix: prevent other plugin types from using dynamic tracing and troubleshooting panel configurations #498

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
6 changes: 6 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/uiplugin/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading