Skip to content

Commit

Permalink
fix(xo-server-load-balancer): simple plan creation
Browse files Browse the repository at this point in the history
  • Loading branch information
b-Nollet committed Feb 5, 2024
1 parent 5d4723e commit c49e7f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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”
- [Import/VM] Fix `UUID_INVALID(VM, OpaqueRef:...)` error when importing from URL
- [Plugin/Load balancer] Preventing the creation of a density plan when simple plan is selected.

### Packages to release

Expand All @@ -32,5 +33,6 @@
- @xen-orchestra/immutable-backups patch
- @xen-orchestra/xva patch
- xo-server patch
- xo-server-load-balancer patch

<!--packages-end-->
4 changes: 3 additions & 1 deletion packages/xo-server-load-balancer/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { EXECUTION_DELAY, debug } from './utils'

const PERFORMANCE_MODE = 0
const DENSITY_MODE = 1
const SIMPLE_MODE = 2
const MODES = { 'Performance mode': PERFORMANCE_MODE, 'Density mode': DENSITY_MODE, 'Simple mode': SIMPLE_MODE }

// ===================================================================

Expand Down Expand Up @@ -147,7 +149,7 @@ class LoadBalancerPlugin {

if (plans) {
for (const plan of plans) {
this._addPlan(plan.mode === 'Performance mode' ? PERFORMANCE_MODE : DENSITY_MODE, plan)
this._addPlan(MODES[plan.mode], plan)
}
}
}
Expand Down

0 comments on commit c49e7f8

Please sign in to comment.