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
metal3: support edit for Bare Metal Hosts #3998
Conversation
validationSchema={addHostValidationSchema} | ||
component={AddBareMetalHostForm} | ||
isNameDisabled={isEditing} | ||
/> |
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.
The context is not needed. By using children
instead of component
prop, it is possible to pass additional props.
/> | |
> | |
{(props) => ( | |
<AddBareMetalHostForm {...props} showUpdated={showUpdated} isEditing={isEditing} /> | |
)} | |
</Formik> |
</Form> | ||
); | ||
}) => { | ||
const { isNameDisabled, isEditing, showUpdated } = React.useContext<any>(AddBareMetalHostContext); |
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.
Not needed with the change described above.
placeholder="openshift-worker" | ||
helpText="Provide unique name for the new Bare Metal Host." | ||
required | ||
isDisabled={isNameDisabled} |
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.
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), |
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 I used Base64.encode
to be in sync with the way it is done in the secrets codebase, but no big deal.
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 used these because it is more straightforward solution
@@ -0,0 +1,6 @@ | |||
import { K8sResourceKind } from '@console/internal/module/k8s'; |
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 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 = ( |
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 should go to @console/shared
as well, in a follow up patch is fine.
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.
ok, let's move these later. This function is used in many places in kubevirt.
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.
a271690
to
a81bc79
Compare
fixed: using inline funciton instead of a context |
/lgtm |
a81bc79
to
32c1bd8
Compare
rebased |
/lgtm |
/test e2e-gcp-console |
1 similar comment
/test e2e-gcp-console |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/hold |
/hold cancel |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
32c1bd8
to
5ebd000
Compare
/lgtm |
[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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
depends on
@jtomasek