-
Notifications
You must be signed in to change notification settings - Fork 667
Bug 1753812: modify view update strategy descriptor #2864
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
Bug 1753812: modify view update strategy descriptor #2864
Conversation
|
@spadgett
|
|
@spadgett |
|
@cyril-ui-developer: This pull request references Bugzilla bug 1753812, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
spadgett
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.
@cyril-ui-developer I'd suggest looking at the OLM configure size modal for an example:
frontend/public/components/modals/configure-update-strategy-modal.tsx
Outdated
Show resolved
Hide resolved
frontend/public/components/modals/configure-update-strategy-modal.tsx
Outdated
Show resolved
Hide resolved
dfcec25 to
a2bec4f
Compare
a2bec4f to
8af04a4
Compare
d6d8811 to
4478cc4
Compare
| const UpdateStrategy: React.FC<SpecCapabilityProps> = (props) => ( | ||
| <div>{_.get(props.value, 'type', 'None')}</div> | ||
| const UpdateStrategy: React.FC<SpecCapabilityProps> = ({ model, obj, descriptor, value }) => ( | ||
| <button |
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.
| <div>{_.get(props.value, 'type', 'None')}</div> | ||
| const UpdateStrategy: React.FC<SpecCapabilityProps> = ({ model, obj, descriptor, value }) => ( | ||
| <button | ||
| data-test-id="edit-annotations" |
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.
data-test-id looks wrong. We should remove it if it's not used in a test
| _.get(resource, getPath) || props.defaultValue, | ||
| ); | ||
| const [maxUnavailable, setMaxUnavailable] = React.useState( | ||
| _.get(resource.spec, 'updateStrategy.rollingUpdate.maxUnavailable', '25%'), |
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.
These paths looks wrong. They should be relative to path. See
| ) | ||
| .then(close, () => {}) | ||
| .catch((error) => { | ||
| throw error; |
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 catch shouldn't be needed if we're only rethrowing the error
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 catch shouldn't be needed if we're only rethrowing the error
Got eslint error when I removed catch - "error Expected catch() or return promise/catch-or-return"
I'm thinking of adding the "promise/catch-or-return": "off" to eslint config file in operator-lifecycle-manager to omit the error or add a return statement to return the promise. Please let me know your thoughts. Thanks.
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 catch shouldn't be needed if we're only rethrowing the error
Added the "promise/catch-or-return": "off" to eslint config file in operator-lifecycle-manager to omit the error.
| const submit = (event) => { | ||
| event.preventDefault(); | ||
|
|
||
| const patch: Patch = { path: '/spec/updateStrategy/rollingUpdate', op: 'remove' }; |
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.
We shouldn't be hard-coding paths here. It should be based on props.path
a4512dc to
fc26a9d
Compare
frontend/packages/.eslintrc.js
Outdated
| @@ -11,5 +11,6 @@ module.exports = { | |||
| message: 'Use lodash instead. webpack is configured to use lodash-es automatically.', | |||
| }, | |||
| ], | |||
| "promise/catch-or-return": "off", | |||
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, are we sure we want this change?
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, are we sure we want this change?
Will remove it and use return.
| } | ||
|
|
||
| handlePromise( | ||
| k8sPatch(resourceKind, resource, [ |
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 we do want a return here
| @@ -0,0 +1,6 @@ | |||
| // This module utilizes dynamic `import()` to enable lazy-loading for each modal instead of including them in the main bundle. | |||
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'd probably skip this since we don't do it for other modals in the package.
fc26a9d to
9353cec
Compare
9353cec to
88b5f8c
Compare
spadgett
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.
/approve
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cyril-ui-developer, spadgett 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 |
|
@cyril-ui-developer: All pull requests linked via external trackers have merged. Bugzilla bug 1753812 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @spadgett