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

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

Subscribers

People subscribed via source and target branches