-
Notifications
You must be signed in to change notification settings - Fork 667
metal3: add node maintenance actions #1967
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
frontend/packages/metal3-plugin/src/components/host-menu-actions.tsx
Outdated
Show resolved
Hide resolved
3752559 to
e1df91c
Compare
|
/assign |
jtomasek
left a comment
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.
Looks pretty good!
frontend/packages/metal3-plugin/src/components/machine-cell.tsx
Outdated
Show resolved
Hide resolved
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.
FYI, this can also be solved via dynamic array declaration pattern:
const resources: FirehoseResource[] = [
{
/* stuff */
},
...(hasNodeMaintenanceCapability && [{
/* stuff */
}] || []),
];But I'm also OK with proposed code.
frontend/packages/metal3-plugin/src/components/host-menu-actions.tsx
Outdated
Show resolved
Hide resolved
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.
I find both ...host property spread and host property inclusion a bit weird.
@suomiy IIRC this is to ensure some basic stuff like IDs gets included, right?
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.
yes it is (UID for example) and the host to have the original unchanged object
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.
This same code is also in host-detail module. Maybe create a function to cut down code duplication?
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.
I think it is better to leave it separate. One might want to add something else to the stateToProps function and forget that somebody else is also using 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.
Well, I didn't mean the whole hostsPageStateToProps function 😃 just the hasNodeMaintenanceCapability computation from k8s object.
Anyway, I'm OK with this as-is.
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.
This object { hasNodeMaintenanceCapability: boolean; } declaration is repeated on many places across many files.
Isn't it better to declare (in types.ts) and consistently reuse
type HostCustomData = {
hasNodeMaintenanceCapability: boolean;
};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.
again, IMO it is better to leave it for better extendability
|
/retest |
|
hopefully fixed and responded to all comments |
|
added correct icon and fixed dialog messages |
|
/retest |
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.
Well, I didn't mean the whole hostsPageStateToProps function 😃 just the hasNodeMaintenanceCapability computation from k8s object.
Anyway, I'm OK with this as-is.
frontend/packages/metal3-plugin/src/components/modals/start-node-maintenance-modal.tsx
Outdated
Show resolved
Hide resolved
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.
Hm, so KubeVirt plugin defines the NodeMaintenanceModel but Metal3 plugin realizes the corresponding actions?
Why isn't NodeMaintenanceModel moved to Metal3 plugin?
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.
ah, you are right; that is much cleaner choice
- detect availability according to NodeMaintenance CRD - start maintenance dialog - enhance & refactor status - small refactoring - reverted the old flatten pattern to support status filtering and to prevent duplicate resource lookup
|
/test e2e-aws-console |
1 similar comment
|
/test e2e-aws-console |
| crd: true, | ||
| }; | ||
|
|
||
| export const NodeMaintenanceModel: K8sKind = { |
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.
👍
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jtomasek, suomiy, vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Dependant PR #1966 is acked and should get merged, please rebase if necessary. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |





prevent duplicate resource lookup
depends on
- [] #1964@jtomasek @honza