From b1a86bb6ff3fa784b733641594eea86c2bb008d9 Mon Sep 17 00:00:00 2001
From: Tom Weininger
Date: Tue, 25 Jan 2022 12:07:38 +0100
Subject: [PATCH] Fix invalid value range for member weight
Octavia supports setting the weight of members from 0 to 256, but
in Horizon the value 0 was not accepted. This fix allows entering
the value 0 as well, which is important for putting a member into
DRAINING state.
Change-Id: I25ce292f962cf6a0d6f017fe7bc47aaed0790efc
Story: 2009804
Task: 44362
---
.../members/actions/edit-member/modal.controller.js | 2 +-
.../members/actions/edit-member/modal.controller.spec.js | 2 +-
.../project/lbaasv2/members/actions/edit-member/modal.html | 2 +-
.../project/lbaasv2/workflow/members/members.controller.js | 2 +-
.../project/lbaasv2/workflow/members/members.help.html | 5 +++--
.../project/lbaasv2/workflow/members/members.html | 2 +-
.../fix-member-weight-value-range-9310678f967c771a.yaml | 7 +++++++
7 files changed, 15 insertions(+), 7 deletions(-)
create mode 100644 releasenotes/notes/fix-member-weight-value-range-9310678f967c771a.yaml
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.js b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.js
index 5f6f2b1c..9d442719 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.js
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.js
@@ -69,7 +69,7 @@
ctrl.cancel = cancel;
ctrl.save = save;
ctrl.saving = false;
- ctrl.weightError = gettext('The weight must be a number between 1 and 256.');
+ ctrl.weightError = gettext('The weight must be a number between 0 and 256.');
ctrl.monitorAddressError = gettext('The monitor address must be a valid IP address.');
ctrl.monitorPortError = gettext('The monitor port must be a number between 1 and 65535.');
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.spec.js b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.spec.js
index 9ebeea0e..2d6c3ed7 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.spec.js
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.controller.spec.js
@@ -71,7 +71,7 @@
expect(ctrl.weight).toBe(1);
expect(ctrl.ipPattern).toBeDefined();
expect(ctrl.helpUrl).toBeDefined();
- expect(ctrl.weightError).toBe('The weight must be a number between 1 and 256.');
+ expect(ctrl.weightError).toBe('The weight must be a number between 0 and 256.');
expect(ctrl.monitorAddressError).toBe('The monitor address must be a valid IP address.');
expect(ctrl.monitorPortError).toBe('The monitor port must be a number between 1 and 65535.');
});
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.html b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.html
index 76c39254..b622d434 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.html
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-member/modal.html
@@ -50,7 +50,7 @@
{$ ::modal.weightError $}
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.controller.js b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.controller.js
index fc8b0c5b..28a44af9 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.controller.js
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.controller.js
@@ -47,7 +47,7 @@
// Error text for invalid fields
ctrl.portError = gettext('The port must be a number between 1 and 65535.');
- ctrl.weightError = gettext('The weight must be a number between 1 and 256.');
+ ctrl.weightError = gettext('The weight must be a number between 0 and 256.');
ctrl.ipError = gettext('The IP address is not valid.');
// Instances transer table widget properties
diff --git a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.help.html b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.help.html
index d5685b67..9a1a20b9 100644
--- a/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.help.html
+++ b/octavia_dashboard/static/dashboard/project/lbaasv2/workflow/members/members.help.html
@@ -30,8 +30,9 @@
Weight:
The weight of a member determines the portion of requests or connections it services compared
- to the other members of the pool. A higher weight means it will receive more traffic. Must be
- a number from 1 to 256.
+ to the other members of the pool. A value of 0 means the member does not receive new connections
+ but continues to service existing connections. A higher weight means it will receive more
+ traffic. Must be a number from 0 to 256.