Merge ~freyes/ubuntu/+source/magnum-ui:bug/2038663-yoga into ~ubuntu-openstack-dev/ubuntu/+source/magnum-ui:stable/yoga

Proposed by Felipe Reyes
Status: Merged
Merged at revision: f4746fc25f97799a5035b708b9fccff12d658423
Proposed branch: ~freyes/ubuntu/+source/magnum-ui:bug/2038663-yoga
Merge into: ~ubuntu-openstack-dev/ubuntu/+source/magnum-ui:stable/yoga
Diff against target: 153 lines (+127/-2)
3 files modified
debian/changelog (+4/-2)
debian/patches/lp2038663.patch (+122/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Ubuntu OpenStack uploaders Pending
Review via email: mp+470652@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 728dc54..537ce7e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,8 +1,10 @@
6-magnum-ui (10.0.0-0ubuntu4) UNRELEASED; urgency=medium
7+magnum-ui (10.0.0-0ubuntu3.1) UNRELEASED; urgency=medium
8
9 * d/gbp.conf: Create stable/yoga branch.
10+ * d/p/lp2038663.patch: Add option to override the fixed subnet when creating
11+ a new cluster (LP: #2038663).
12
13- -- Felipe Reyes <felipe.reyes@canonical.com> Tue, 21 Mar 2023 09:33:40 -0300
14+ -- Felipe Reyes <felipe.reyes@canonical.com> Mon, 05 Aug 2024 12:47:57 -0400
15
16 magnum-ui (10.0.0-0ubuntu3) jammy; urgency=medium
17
18diff --git a/debian/patches/lp2038663.patch b/debian/patches/lp2038663.patch
19new file mode 100644
20index 0000000..116455a
21--- /dev/null
22+++ b/debian/patches/lp2038663.patch
23@@ -0,0 +1,122 @@
24+From 6f6c3db282fe2f0e08ad69c557eb153858b0164a Mon Sep 17 00:00:00 2001
25+From: Felipe Reyes <felipe.reyes@canonical.com>
26+Date: Tue, 10 Oct 2023 18:33:27 -0300
27+Subject: [PATCH] Add dropdown list to select fixed subnet
28+
29+When creating a cluster and the user decides to reuse an existing
30+network, it must also choose a subnet, otherwise the resulting
31+configuration may be invalid when trying to allocate a port.
32+
33+Closes-Bug: #2038663
34+Related-Bug: #2038109
35+Change-Id: I08943f10418385a39eecc7b4117d162854d2d010
36+---
37+ .../clusters/create/create.service.js | 1 +
38+ .../clusters/workflow/workflow.service.js | 39 ++++++++++++++++++-
39+ 2 files changed, 39 insertions(+), 1 deletion(-)
40+
41+--- a/magnum_ui/static/dashboard/container-infra/clusters/create/create.service.js
42++++ b/magnum_ui/static/dashboard/container-infra/clusters/create/create.service.js
43+@@ -112,6 +112,7 @@
44+
45+ if (!model.create_network) {
46+ addFieldToRequestObjectIfSet('fixed_network','fixed_network');
47++ addFieldToRequestObjectIfSet('fixed_subnet','fixed_subnet');
48+ }
49+ // Labels processing order (the following overrides previous):
50+ // Cluster Templates -> Create Form -> User-defined in 'labels' textarea
51+--- a/magnum_ui/static/dashboard/container-infra/clusters/workflow/workflow.service.js
52++++ b/magnum_ui/static/dashboard/container-infra/clusters/workflow/workflow.service.js
53+@@ -52,6 +52,7 @@
54+ function init(title, $scope) {
55+ var schema, form;
56+
57++ var fixedSubnetsInitial = gettext('Choose an existing subnet');
58+ // Default <option>s; will be shown in selector as a placeholder
59+ var templateTitleMap = [{value: '', name: gettext('Choose a Cluster Template') }];
60+ var availabilityZoneTitleMap = [{value: '',
61+@@ -62,6 +63,7 @@
62+ var workerFlavorTitleMap = [{value: '',
63+ name: gettext('Choose a Flavor for the Worker Node')}];
64+ var networkTitleMap = [{value: '', name: gettext('Choose an existing network')}];
65++ var subnetTitleMap = [{value: '', name: fixedSubnetsInitial}];
66+ var ingressTitleMap = [{value: '', name: gettext('Choose an ingress controller')}];
67+
68+ var addonsTitleMap = [];
69+@@ -102,6 +104,7 @@
70+ 'master_lb_enabled': {type: 'boolean'},
71+ 'create_network': { type: 'boolean' },
72+ 'fixed_network': { type: 'string' },
73++ 'fixed_subnet': { type: 'string' },
74+ 'floating_ip_enabled': { type: 'boolean' },
75+ 'ingress_controller': { type: 'object' },
76+
77+@@ -332,6 +335,7 @@
78+ onChange: function(isNewNetwork) {
79+ if (isNewNetwork) {
80+ model.fixed_network = MODEL_DEFAULTS.fixed_network;
81++ model.fixed_subnet = MODEL_DEFAULTS.fixed_subnet;
82+ }
83+ }
84+ },
85+@@ -341,6 +345,17 @@
86+ title: gettext('Use an Existing Network'),
87+ titleMap: networkTitleMap,
88+ condition: 'model.create_network === false',
89++ required: true,
90++ onChange: function () {
91++ changeFixedNetwork(model);
92++ }
93++ },
94++ {
95++ key: 'fixed_subnet',
96++ type: 'select',
97++ title: gettext('Use an Existing Subnet'),
98++ titleMap: subnetTitleMap,
99++ condition: 'model.create_network === false',
100+ required: true
101+ }
102+ ]
103+@@ -486,6 +501,7 @@
104+ master_lb_enabled: false,
105+ create_network: true,
106+ fixed_network: '',
107++ fixed_subnet: '',
108+ floating_ip_enabled: false,
109+ ingress_controller: '',
110+
111+@@ -570,12 +586,33 @@
112+
113+ function onGetNetworks(response) {
114+ angular.forEach(response.data.items, function(network) {
115+- networkTitleMap.push({value: network.id, name: network.name + ' (' + network.id + ')'});
116++ networkTitleMap.push({
117++ value: network.id,
118++ name: network.name + ' (' + network.id + ')',
119++ subnets: network.subnets
120++ });
121+ });
122+
123+ setSingleItemAsDefault(response.data.items, 'fixed_network', 'id');
124+ }
125+
126++ function changeFixedNetwork(model) {
127++ if (model.fixed_network) {
128++ subnetTitleMap = [{value:"", name: gettext("Choose an existing Subnet")}];
129++ angular.forEach(networkTitleMap, function(network) {
130++ if (network.value === model.fixed_network) {
131++ angular.forEach(network.subnets, function(subnet) {
132++ subnetTitleMap.push({value: subnet.id, name: subnet.name});
133++ });
134++ }
135++ });
136++ } else {
137++ fixedSubnets = [{value:"", name: fixedSubnetsInitial}];
138++ model.fixed_subnet = "";
139++ }
140++ form[0].tabs[2].items[0].items[0].items[3].titleMap = subnetTitleMap;
141++ }
142++
143+ function onGetIngressControllers(response) {
144+ angular.forEach(response.data.controllers, function(ingressController) {
145+ ingressTitleMap.push({value: ingressController, name: ingressController.name});
146diff --git a/debian/patches/series b/debian/patches/series
147index e04ba14..a6c48b3 100644
148--- a/debian/patches/series
149+++ b/debian/patches/series
150@@ -1,2 +1,3 @@
151 skip-tests.patch
152 install-all-files.patch
153+lp2038663.patch

Subscribers

People subscribed via source and target branches