-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: refactor config-related api #7773
base: main
Are you sure you want to change the base?
feat: refactor config-related api #7773
Conversation
8a19366
to
b180fca
Compare
b180fca
to
b912e2b
Compare
apis/apps/v1alpha1/type.go
Outdated
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MaxLength=63 | ||
// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$` | ||
Name string `json:"name"` |
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.
There's no need to bind parameters to config files. Instead, we should define a list of parameters (key-value pairs) for a Component in the ComponentDefinition, along with specifying how modifications to these parameters take effect. This way, users can set these parameters for the Component directly without specifying the config files in which they reside.
This approach is preferable for two reasons:
- It reduces the burden on users by eliminating the need to specify config files when setting parameters.
- Some parameters don't appear in any config files at all.
apis/apps/v1alpha1/type.go
Outdated
// The ParametersDefinition object defines the format of the configuration file and all parameters type. | ||
// | ||
// +optional | ||
ParametersDef string `json:"parametersDefName,omitempty"` |
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.
ParametersDef should be taken out and decoupled from ConfigTemplate, as some parameters are not present in configuration files.
You can try to place ParametersDef under ComponentDefinition directly.
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.
If some parameters reside in Config Templates, they should be identified and referenced in the ParametersDef.
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.
What I want to express is that ParameterDef should not be a supplementary description of the Config Template ConfigMap.
Instead, it should be a list of parameters that are allowed to be set for a Component. If modifying one of these parameters requires updating a configuration file, then this configuration file should be referenced in the description of that parameter.
b912e2b
to
0cee5a4
Compare
23c53ff
to
4703634
Compare
4703634
to
851ce9a
Compare
No description provided.