-
Notifications
You must be signed in to change notification settings - Fork 667
Fix NetworkAttachmentDefinition configs & redirect after YAML creation bug #3177
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
Fix NetworkAttachmentDefinition configs & redirect after YAML creation bug #3177
Conversation
55d79e4 to
e2a9a43
Compare
|
/retest |
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.
In addition to my comments above, please add typescript, i.e. NetworkAttachmentDefinitionFormBase, NetworkTypeOptions, createNetAttachDef and others.
...ugin/src/components/network-attachment-definitions/NetworkAttachmentDefinitionCreateYaml.tsx
Show resolved
Hide resolved
| try { | ||
| ipam = JSON.parse(_.get(typeParamsData, 'ipam.value', {})); | ||
| } catch (e) { | ||
| console.log(e); // eslint-disable-line no-console |
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 user should be informed about unexpected format of data, the console logging is just optional way to handle that state.
In any case, the log message should be at least info level and provide additional info about context for debugging.
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.
Very good points. I'll address this in a follow-up.
| const vlan = _.get(typeParamsData, 'vlanTagNum.value', ''); | ||
| config.plugins = [ | ||
| { | ||
| type: 'cnv-bridge', |
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.
repeating string, worth of a constant
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.
Agreed. This will be addressed in a follow-up.
| }, | ||
| { type: 'cnv-tuning' }, | ||
| ]; | ||
| } else if (networkType === 'sriov') { |
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.
likewise here
Please check other similar occurrences.
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.
Agreed. This will be addressed in a follow-up.
|
Can't comment on the code, but the output looks fine. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pcbailey, phoracek 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 |
|
This commit was included in #3183. Closing this PR. |
This PR fixes the content and structure of the configurations created by using the network attachment definitions form. Example configurations created using the form are below. This PR also fixes an issue where the user was redirected to the wrong URL after successfully creating a network attachment definition via YAML.
Bridge:
SR-IOV: