Skip to content
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

Remove power fields meant for individual nodes from add chassis form. #1088

Merged
merged 4 commits into from
May 7, 2020

Conversation

Caleb-Ellis
Copy link
Contributor

@Caleb-Ellis Caleb-Ellis commented May 5, 2020

Done

  • Power type fields with scope: "node" are now filtered from add chassis form.
  • Renamed trimPowerParameters to formatPowerParameters - now it acts as a bit of an integration layer between Formik and the add machine/add chassis apis (scanned the maas code and found that the add chassis api expects different parameters names than add machine).
  • Added more tests to do with adding chassis.

QA

  • Click Add hardware > Chassis and check that the power types are filtered by chassis: true and the fields are filtered by scope: "bmc" according to state.general.powerTypes.data.
  • Try to add chassis using the form fields given - note there is a bug in the api where some of the power types have chassis: true when they shouldn't be so you might get an error that the power type is not for chassis.

Fixes

Fixes #1084

Launchpad Issue

1876680

@Caleb-Ellis Caleb-Ellis force-pushed the chassis-power-fields branch from eb3782d to 7e6b7ad Compare May 6, 2020 05:25
// When adding a chassis we need only a subset of fields that aren't specific
// to individual nodes.
const fields = forChassis
? powerTypeFields.filter((field) => field.scope !== "node")
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I can tell the scopes are either "node" or "bmc". If a third type was added would this filter still be correct? Or would we only want the fields that are scoped to "bmc"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure to be honest. I know for certain we don't want "node" scopes, and the only two scopes are "node" and "bmc". But whether or not an extra scope might include chassis will depend on the core team keeping us in the loop.

@Caleb-Ellis Caleb-Ellis merged commit 4162abf into canonical:master May 7, 2020
@Caleb-Ellis Caleb-Ellis deleted the chassis-power-fields branch May 7, 2020 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Add chassis" uses power driver parameters for a single machine
2 participants