Skip to content

Conversation

@atiratree
Copy link
Member

@atiratree atiratree commented Jul 9, 2019

  • 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

depends on
- [] #1964

@jtomasek @honza

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 9, 2019
@spadgett spadgett added this to the v4.2 milestone Jul 9, 2019
@atiratree atiratree force-pushed the nodeDrain branch 3 times, most recently from 3752559 to e1df91c Compare July 9, 2019 19:00
@atiratree atiratree changed the title add node maintenance actions metal3: add node maintenance actions Jul 9, 2019
@atiratree
Copy link
Member Author

Screenshots

Start Maintenance

start

--

start-dialog

Stop Maintenance

list

--

stop

Stopping Maintenance

stopping

@jtomasek
Copy link

/assign

Copy link

@jtomasek jtomasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good!

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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;
};

Copy link
Member Author

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

@atiratree
Copy link
Member Author

/retest

@atiratree
Copy link
Member Author

hopefully fixed and responded to all comments

@atiratree
Copy link
Member Author

added correct icon and fixed dialog messages

@atiratree
Copy link
Member Author

/retest

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Member Author

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

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 16, 2019
suomiy added 2 commits July 17, 2019 12:26
- 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
@atiratree
Copy link
Member Author

/test e2e-aws-console
/test e2e-aws

1 similar comment
@atiratree
Copy link
Member Author

/test e2e-aws-console
/test e2e-aws

crd: true,
};

export const NodeMaintenanceModel: K8sKind = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vojtechszocs
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2019
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2019
@vojtechszocs
Copy link
Contributor

Dependant PR #1966 is acked and should get merged, please rebase if necessary.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit f3e76f3 into openshift:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants