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

fix(xo-web/new/network): correct type for vlan #6829

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”

- [VM] Fix `VBD_IS_EMPTY` error when converting to template [Forum#61653](https://xcp-ng.org/forum/post/61653) (PR [#6808](https://github.com/vatesfr/xen-orchestra/pull/6808))
- -[New/Network] Fix `invalid parameter error` when not providing a VLAN [Forum#62090](https://xcp-ng.org/forum/post/62090) (PR [#6829](https://github.com/vatesfr/xen-orchestra/pull/6829))

### Packages to release

Expand All @@ -30,5 +31,6 @@
<!--packages-start-->

- xo-server patch
- xo-web patch

<!--packages-end-->
4 changes: 2 additions & 2 deletions packages/xo-server/src/api/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function create({ pool, name, description, pif, mtu = 1500, vlan =
description,
pifId: pif && this.getObject(pif, 'PIF')._xapiId,
mtu: +mtu,
vlan: +vlan,
vlan,
})

if (nbd) {
Expand All @@ -27,7 +27,7 @@ create.params = {
description: { type: 'string', minLength: 0, optional: true },
pif: { type: 'string', optional: true },
mtu: { type: 'integer', optional: true },
vlan: { type: ['integer', 'string'], optional: true },
vlan: { type: 'integer', optional: true },
}

create.resolve = {
Expand Down
4 changes: 2 additions & 2 deletions packages/xo-web/src/xo-app/new/network/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ const NewNetwork = decorate([
networks,
pif,
pifs,
vlan,
} = state

let { mtu } = state
let { mtu, vlan } = state
mtu = mtu === '' ? undefined : +mtu
vlan = vlan === '' ? undefined : +vlan

return bonded
? createBondedNetwork({
Expand Down