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

metal3: support edit for Bare Metal Hosts #3998

Merged

Conversation

atiratree
Copy link
Member

@atiratree atiratree commented Jan 17, 2020

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 17, 2020
@atiratree atiratree mentioned this pull request Jan 17, 2020
@openshift-ci-robot openshift-ci-robot added component/metal3 Related to metal3-plugin component/shared Related to console-shared labels Jan 17, 2020
@atiratree
Copy link
Member Author

design

att

validationSchema={addHostValidationSchema}
component={AddBareMetalHostForm}
isNameDisabled={isEditing}
/>

Choose a reason for hiding this comment

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

The context is not needed. By using children instead of component prop, it is possible to pass additional props.

Suggested change
/>
>
{(props) => (
<AddBareMetalHostForm {...props} showUpdated={showUpdated} isEditing={isEditing} />
)}
</Formik>

</Form>
);
}) => {
const { isNameDisabled, isEditing, showUpdated } = React.useContext<any>(AddBareMetalHostContext);

Choose a reason for hiding this comment

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

Not needed with the change described above.

placeholder="openshift-worker"
helpText="Provide unique name for the new Bare Metal Host."
required
isDisabled={isNameDisabled}

Choose a reason for hiding this comment

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

Since isEditing is used to toggle parts of the form in case of editing, using isNameDisabled is not needed and can be replaced by isEditing

@@ -13,8 +12,8 @@ export const buildBareMetalHostSecret = (name, namespace, username, password) =>
name: getSecretName(name),
},
data: {
username: Base64.encode(username),
password: Base64.encode(password),
username: btoa(username),

Choose a reason for hiding this comment

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

I think I used Base64.encode to be in sync with the way it is done in the secrets codebase, but no big deal.

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 used these because it is more straightforward solution

@@ -0,0 +1,6 @@
import { K8sResourceKind } from '@console/internal/module/k8s';

Choose a reason for hiding this comment

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

This file should go in @console/shared but I am fine with doing it in a follow up.

import { FirehoseResult } from '@console/internal/components/utils';
import { K8sResourceKind } from '@console/internal/module/k8s';

export const getLoadedData = (

Choose a reason for hiding this comment

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

This should go to @console/shared as well, in a follow up patch is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, let's move these later. This function is used in many places in kubevirt.

Copy link
Member Author

Choose a reason for hiding this comment

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

@atiratree
Copy link
Member Author

fixed: using inline funciton instead of a context

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 20, 2020
@jtomasek
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@atiratree
Copy link
Member Author

rebased

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2020
@jtomasek
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@jelkosz
Copy link

jelkosz commented Jan 21, 2020

/test e2e-gcp-console

1 similar comment
@jelkosz
Copy link

jelkosz commented Jan 21, 2020

/test e2e-gcp-console

@openshift-bot
Copy link
Contributor

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@atiratree
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

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

@atiratree
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

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

@atiratree
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@spadgett
Copy link
Member

/hold
the merge queue is blocked

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2020
@spadgett
Copy link
Member

/hold cancel
/retest

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 22, 2020
@openshift-bot
Copy link
Contributor

/retest

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

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@jtomasek
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jtomasek, suomiy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-bot
Copy link
Contributor

/retest

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

1 similar comment
@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 eb3f27f into openshift:master Jan 22, 2020
@spadgett spadgett added this to the v4.4 milestone Jan 27, 2020
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. component/metal3 Related to metal3-plugin component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants