-
Notifications
You must be signed in to change notification settings - Fork 3
fix(vi): handle vi default storage class from module config #902
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
Conversation
7c204e6 to
a7fbb78
Compare
Signed-off-by: Roman Sysoev <[email protected]>
a53757f to
7ea57da
Compare
| }) | ||
| } | ||
|
|
||
| func IndexVIByNotReadyStorageClass(ctx context.Context, mgr manager.Manager) error { |
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.
Why with this name you indexing by sc ready? And ignore non pvc VI please.
| return nil, err | ||
| } | ||
|
|
||
| if virtualImages, ok := moduleConfig.Spec.Settings["virtualImages"].(map[string]interface{}); ok { |
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.
Do not hardcode please, use constant not string literal (set it if needed), next line too
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.
"virtualImages" var seems like slice of VI, use virtualImagesSetting or something
| var ( | ||
| moduleConfigViDefaultStorageClass string | ||
| moduleConfig mcapi.ModuleConfig | ||
| moduleConfigName = "virtualization" |
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.
Can it change?
| oldViDefaultSc string | ||
| newViDefaultSc string | ||
| ) | ||
| if virtualImages, ok := oldMc.Spec.Settings["virtualImages"].(map[string]interface{}); ok { |
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.
Use consts, not string literals
Description
Why do we need it, and what problem does it solve?
When a
VirtualImageis created without theStorageClassfield in its specification and the default storage class is absent from theModuleConfig, it is not handled after updating the default storage class in theModuleConfig.What is the expected result?
The default storage class field works properly in the reconciliation loop of the
VirtualImageresource.Checklist
Changelog entries