-
Notifications
You must be signed in to change notification settings - Fork 26
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
K8SPS-212: Add validation rules #308
base: main
Are you sure you want to change the base?
Conversation
- message: HAProxy can not be enabled with 'group-replication' clusterType | ||
rule: 'self.mysql.clusterType==''group-replication'' ? !self.proxy.haproxy.enabled | ||
: true' | ||
- message: HAProxy and Orchestrator must be enabled with 'async' clusterType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not true, you can have only 1 MySQL server and you should not have orc and HaProxy for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.. then the rules would be
- HAProxy and Orchestrator must be enabled with 'async' clusterType if
mysql.size > 1
- HAProxy must be enabled with 'async' clusterType if
mysql.size == 1
Is that right @hors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inelpandzic let's remove
HAProxy must be enabled with 'async' clusterType if mysql.size == 1
@@ -8067,6 +8067,16 @@ spec: | |||
type: string | |||
type: object | |||
type: object | |||
x-kubernetes-validations: | |||
- message: HAProxy can not be enabled with 'group-replication' clusterType | |||
rule: 'self.mysql.clusterType==''group-replication'' ? !self.proxy.haproxy.enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we support HAProxy + GR
commit: a4df791 |
CHANGE DESCRIPTION
Problem:
Some CR fields and their values are related in the sense when one field value is specified, some other should be a certain value. For example, if we set
clusterType=group-replication
thenhaproxy.enabled
should be false. Now you can set it to enabled, but HAProxy would not be started at all since it does not work with GR cluster type.Cause:
Lack of validation when applying the CR.
Solution:
Utilise CRD Validation Rules to validate CR upon creation and reject the create request if certain rules are not met.
Now when the user wants to create a CR with GR cluster type and he enables HAProxy, he will get a response like this.
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability